Skip to content

Commit d467170

Browse files
committed
Fixing UNB-1989 Fail early for custom model upload issues
1 parent 27b430b commit d467170

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8-
## Unreleased
8+
## [Unreleased]
9+
10+
### Fixed
11+
12+
* Fail early if `custom_model_code` or `dependent_dir` are `None` when model type is `ModelType.custom`.
13+
14+
## [0.2.0a0]
915

1016
### Added
1117

unboxapi/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,13 @@ def add_model(
310310
assert (
311311
model_type is ModelType.custom
312312
), "model_type must be ModelType.custom if specifying custom_model_code"
313+
if model_type is ModelType.custom:
314+
assert (
315+
custom_model_code is not None
316+
), "Must specify custom_model_code when using ModelType.custom"
317+
assert (
318+
dependent_dir is not None
319+
), "Must specify dependent_dir when using ModelType.custom"
313320
if task_type in [TaskType.TabularClassification, TaskType.TabularRegression]:
314321
required_fields = [
315322
(feature_names, "feature_names"),

0 commit comments

Comments
 (0)