rusackas commented on code in PR #41964:
URL: https://github.com/apache/superset/pull/41964#discussion_r3565543881


##########
superset/connectors/sqla/models.py:
##########
@@ -1516,7 +1516,18 @@ def full_name(self) -> str:
     def dttm_cols(self) -> list[str]:
         l = [c.column_name for c in self.columns if c.is_dttm]  # noqa: E741
         if self.main_dttm_col and self.main_dttm_col not in l:
-            l.append(self.main_dttm_col)
+            # Only treat ``main_dttm_col`` as a datetime column when the 
column it
+            # points to is actually temporal. A column whose "Is Temporal" 
flag was
+            # removed must not keep being reported as a datetime column just 
because
+            # it is still referenced by ``main_dttm_col`` (#30510). When the 
column
+            # is not present on the dataset, fall back to the legacy behavior 
of
+            # trusting ``main_dttm_col``.
+            main_dttm_column = next(
+                (c for c in self.columns if c.column_name == 
self.main_dttm_col),
+                None,
+            )

Review Comment:
   Same as the throwaway-local case above, these are simple test fixtures and 
mypy infers them fine. Leaving as is.



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