debabsah commented on issue #40501: URL: https://github.com/apache/superset/issues/40501#issuecomment-4820802394
I dug into this and it looks localized. In `superset/models/helpers.py`, the relative-offset branch ties the inner bounds to the shifted clone range: ``` query_object_clone.inner_from_dttm = query_object_clone.from_dttm query_object_clone.inner_to_dttm = query_object_clone.to_dttm ``` while the date-range-offset branch just above it deliberately sets them to `None`. The inner time filter later uses `inner_from_dttm or from_dttm` when it builds the query, so on a coarse time grain that inner bound is what decides whether an incomplete current period compares against the equivalent partial prior period or the full shifted bucket. That lines up with the `2025-05-01 : 2025-05-31` vs `2025-05-01 : 2025-05-28` difference you described. I do not see a PR up yet, so I am happy to pick this up, with no wish to step on anyone if it is already in progress. One question on intended behavior before I do: for a relative offset on a coarse grain with an incomplete current period, should the comparison track the original period's extent (shifted), i.e. your expected `2025-05-01 : 2025-05-28`? I will reproduce on the month example, confirm the exact interaction with the time-grain bucketing, and add a regression test. -- 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]
