bito-code-review[bot] commented on PR #43500:
URL: https://github.com/apache/superset/pull/43500#issuecomment-5405367692

   <!-- Bito Reply -->
   The flagged issue is correct. The current implementation in 
`superset/commands/chart/update.py` raises `DatasourceTypeInvalidError` inside 
the `try` block, which causes it to be caught and appended to the validation 
errors. If `datasource_type` is missing, a 
`DatasourceTypeUpdateRequiredValidationError` is already present, and appending 
the invalid-type error for an empty string overwrites the more relevant 
required-field message.
   
   To resolve this, you should only perform the `DatasourceType` check when 
`datasource_type` is provided. You can update the guard in 
`superset/commands/chart/update.py` as follows:
   
   ```python
                   if datasource_type and datasource_type != 
DatasourceType.TABLE:
                       raise DatasourceTypeInvalidError()
   ```
   
   This ensures the check only runs when a type is supplied, preserving the 
existing required-field validation when it is missing. Would you like me to 
check the rest of the comments on this PR to see if there are other issues to 
address?
   
   **superset/commands/chart/update.py**
   ```
   if datasource_type and datasource_type != DatasourceType.TABLE:
                       raise DatasourceTypeInvalidError()
   ```


-- 
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]

Reply via email to