korbit-ai[bot] commented on code in PR #33845:
URL: https://github.com/apache/superset/pull/33845#discussion_r2159407877
##########
superset/daos/dataset.py:
##########
@@ -197,7 +197,7 @@ def update(
cls.update_metrics(item, attributes.pop("metrics"))
force_update = True
- if force_update:
+ if attributes or force_update:
attributes["changed_on"] = datetime.now()
Review Comment:
### Undocumented changed_on timestamp behavior change <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The change in the condition from `if force_update:` to `if attributes or
force_update:` is not documented. This is a significant behavior change that
affects when the `changed_on` timestamp is updated.
###### Why this matters
Future developers may not understand why both empty attributes and
force_update can trigger a timestamp update, leading to potential confusion
about the timestamp update behavior.
###### Suggested change ∙ *Feature Preview*
Update the method's docstring to explain:
```python
"""Updates a Dataset model on the metadata DB
The changed_on timestamp is updated when there are attribute changes
or when columns/metrics are updated (force_update).
"""
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6eefdf29-a9ab-4a38-93dd-90b0ddebecca/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6eefdf29-a9ab-4a38-93dd-90b0ddebecca?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6eefdf29-a9ab-4a38-93dd-90b0ddebecca?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6eefdf29-a9ab-4a38-93dd-90b0ddebecca?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/6eefdf29-a9ab-4a38-93dd-90b0ddebecca)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:13313d04-c090-4fae-adf0-c2eadd5fc0b7 -->
[](13313d04-c090-4fae-adf0-c2eadd5fc0b7)
--
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]