codeant-ai-for-open-source[bot] commented on code in PR #41964:
URL: https://github.com/apache/superset/pull/41964#discussion_r3564819612
##########
tests/unit_tests/connectors/sqla/models_test.py:
##########
@@ -1177,3 +1177,46 @@ def
test_validate_stored_expression_rejects_subquery_around_jinja(
None,
"(SELECT password FROM ab_user LIMIT 1) {# x #}",
)
+
+
+def test_dttm_cols_excludes_column_after_temporal_flag_removed(
+ session: Session,
+) -> None:
+ """
+ Regression for #30510: when a column is mistakenly marked temporal, set as
the
+ dataset's default datetime (``main_dttm_col``) and saved, then later has
its
+ ``is_dttm`` flag removed, the dataset must stop treating that column as
temporal.
+
+ Otherwise ``dttm_cols`` (which feeds time-column selection and the default
time
+ filter for every chart built on the dataset) keeps returning a non-temporal
+ column, corrupting the dataset with a time filter that cannot be removed.
+ """
+ Database.metadata.create_all(session.bind)
+ database = Database(database_name="my_db", sqlalchemy_uri="sqlite://")
Review Comment:
✅ **Customized review instruction saved!**
**Instruction:**
> Do not require explicit type annotations for throwaway local variables in
test code when the suite's typing checks already pass.
**Applied to:**
- `**/test/**`
- `**/tests/**`
- `**/*test*.py`
---
💡 *To manage or update this instruction, visit: [CodeAnt AI
Settings](https://app.codeant.ai/org/settings/learnings)*
--
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]