bito-code-review[bot] commented on PR #44416:
URL: https://github.com/apache/superset/pull/44416#issuecomment-5726003768
<!-- Bito Reply -->
The flagged issue is correct. In the original code, if `datasource_id` was
`None` during a type-only update, the logic would fall back to the existing
`datasource_id` from the model, potentially bypassing validation if the new
`datasource_type` was incompatible with that ID. The PR resolves this by
explicitly checking `effective_id` and raising a
`DatasourceNotFoundValidationError` if it is `None` before proceeding with the
datasource lookup and access check.
I have reviewed the changes in `superset/commands/chart/update.py` and they
correctly implement this validation. No further action is required for this
specific comment.
Regarding other comments on this PR: I have checked the provided files and
there are no other review comments in the `pr_comments.csv` file.
**superset/commands/chart/update.py**
```
# A type-only change still selects a different datasource namespace.
effective_id: int | None = (
datasource_id
if datasource_id is not None
else self._model.datasource_id
)
if effective_id is None:
raise DatasourceNotFoundValidationError()
```
--
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]