-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix: Errors when saving dataset #24113
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,14 +34,14 @@ def validate_python_date_format(value: str) -> None: | |
r""" | ||
^( | ||
epoch_s|epoch_ms| | ||
(?P<date>%Y(-%m(-%d)?)?)([\sT](?P<time>%H(:%M(:%S(\.%f)?)?)?))? | ||
(?P<date>%Y([-/]%m([-/]%d)?)?)([\sT](?P<time>%H(:%M(:%S(\.%f)?)?)?))? | ||
)$ | ||
""", | ||
re.VERBOSE, | ||
) | ||
match = regex.match(value or "") | ||
if not match: | ||
raise ValidationError(_("Invalid date/timestamp format")) | ||
raise ValidationError([_("Invalid date/timestamp format")]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The API error response was malformed without this, was giving |
||
|
||
|
||
class DatasetColumnsPutSchema(Schema): | ||
|
@@ -56,7 +56,7 @@ class DatasetColumnsPutSchema(Schema): | |
filterable = fields.Boolean() | ||
groupby = fields.Boolean() | ||
is_active = fields.Boolean(allow_none=True) | ||
is_dttm = fields.Boolean(dump_default=False) | ||
is_dttm = fields.Boolean(allow_none=True, dump_default=False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Columns can have |
||
python_date_format = fields.String( | ||
allow_none=True, validate=[Length(1, 255), validate_python_date_format] | ||
) | ||
|
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.
Allows for the field to be cleared, before an empty string was failing a
Length(1, 255)
validation