mistercrunch commented on code in PR #39344:
URL: https://github.com/apache/superset/pull/39344#discussion_r3197090226
##########
superset/models/helpers.py:
##########
@@ -1881,10 +1881,26 @@ def join_offset_dfs(
time_grain
)
- if join_column_producer and not time_grain:
- raise QueryObjectValidationError(
- _("Time Grain must be specified when using Time Shift.")
+ if not time_grain:
+ has_temporal_join_key = any(
+ pd.api.types.is_datetime64_any_dtype(df[key])
+ for key in join_keys
+ if key in df.columns
)
Review Comment:
This is a fair point in theory, but in practice the temporal columns
reaching `join_offset_dfs` have already been converted to proper datetime64 by
`processing_time_offsets` upstream. The `is_datetime64_any_dtype` check here is
a defense-in-depth guard — the primary fix is the separator-aware matching in
`renameOperator.ts` that prevents duplicate column names from being generated
in the first place. I think the current check is sufficient for the guardrail's
purpose.
--
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]