-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow certain config parameters from accepting null
as a value
#3079
Conversation
Unit Test Results 6 files + 1 6 suites +1 5h 28m 7s ⏱️ + 1h 45m 46s For more details on these failures, see this check. Results for commit b0543ce. ± Comparison against base commit 1f83833. ♻️ This comment has been updated with latest results. |
This reverts commit 999e4f1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General feedback is that it's confusing to both have None
be the default and allow_none=False
. I would suggest either:
- Making
allow_none=True
the default - Making
default
a required param
Makes sense @tgaddair. I made |
ludwig/schema/utils.py
Outdated
description: str = "", | ||
max: Optional[float] = None, | ||
parameter_metadata: ParameterMetadata = None, | ||
): | ||
"""Returns a dataclass field with marshmallow metadata enforcing numeric inputs must be nonnegative.""" | ||
val = validate.Range(min=0.0, max=max) | ||
allow_none = allow_none or default is None | ||
# allow_none = allow_none or default is None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented code.
ludwig/schema/utils.py
Outdated
@@ -605,7 +603,7 @@ def FloatRange( | |||
"""Returns a dataclass field with marshmallow metadata enforcing numeric inputs must be in range set by | |||
relevant keyword args.""" | |||
val = validate.Range(min=min, max=max, min_inclusive=min_inclusive, max_inclusive=max_inclusive) | |||
allow_none = allow_none or default is None | |||
# allow_none = allow_none or default is None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
assert train_losses[last_entry - 1] <= train_losses[0] | ||
# ensure train loss for last entry is less than to the first entry. | ||
np.testing.assert_array_less(train_losses[last_entry - 1], train_losses[0]) | ||
# assert train_losses[last_entry - 1] <= train_losses[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only nit is to remove the dead code you commented out.
No description provided.