rusackas commented on code in PR #43500:
URL: https://github.com/apache/superset/pull/43500#discussion_r3869478693
##########
superset/commands/chart/update.py:
##########
@@ -221,8 +223,22 @@ def validate(self) -> None: # noqa: C901
exceptions.append(ex)
# Validate/Populate datasource
- if datasource_id is not None:
+ # An empty datasource_type was already flagged above via
+ # DatasourceTypeUpdateRequiredValidationError; skip this block so
+ # we don't clobber that message with DatasourceTypeInvalidError.
+ if datasource_id is not None and datasource_type:
Review Comment:
Good catch, fixed! The check now fires whenever `datasource_type` is
present, not just alongside `datasource_id`, so a type-only update cant slip a
saved_query/query type past it anymore.
##########
superset/commands/chart/update.py:
##########
@@ -221,8 +223,22 @@ def validate(self) -> None: # noqa: C901
exceptions.append(ex)
# Validate/Populate datasource
- if datasource_id is not None:
+ # An empty datasource_type was already flagged above via
+ # DatasourceTypeUpdateRequiredValidationError; skip this block so
+ # we don't clobber that message with DatasourceTypeInvalidError.
+ if datasource_id is not None and datasource_type:
Review Comment:
Good catch, fixed! The check now fires whenever `datasource_type` is
present, not just alongside `datasource_id`, so a type-only update can't slip a
saved_query/query type past it anymore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]