rebenitez1802 commented on code in PR #45598: URL: https://github.com/apache/superset/pull/45598#discussion_r4353328197
########## docs/docs/using-superset/exploring-data.mdx: ########## @@ -489,6 +489,25 @@ The **Custom** time range picker accepts natural language expressions alongside These expressions are evaluated at query time, so saved charts always display data relative to the current date. +### Sunburst cross-filtering + +Sunburst cross-filters use the underlying hierarchy values, not the formatted +segment labels. For time-grained temporal levels, selecting a segment filters the +entire bucket. Adaptive date formatting includes the year in month and quarter +labels to distinguish buckets across years; other grains keep their compact labels. +For supported bucket ranges, the selection replaces the target chart's Time Range +and also applies to its other temporal range filters, even on another time column. +Drill to detail retains the selected bucket within the chart's time range, including +a dataset Hours offset. Drill by filters a time-grained segment by its bucket range. +As with Time-series charts, a chart or dashboard Time Range replaces that range, and an +engine-specific grain without a fixed length matches only the start of the bucket. Review Comment: Non-blocking (this happens on master too): these lines overstate what grained drills do in the default setup. A Sunburst level is grained only when it is the query's `granularity` (a dashboard Time Column filter or a legacy `granularity_sqla`). With no `x_axis`, `QueryContextFactory._apply_granularity` (`query_context_factory.py:410-436`) does two things. It drops **every** filter on the granularity column, whatever the operator. Then it rebuilds the time bounds from the **first** `TEMPORAL_RANGE`, which is usually the chart's own default `No filter`. So in a SQLite repro (4 rows, 2 in the clicked month, Time Column `ts`, Time Grain P1M), I got these results: - Drill by with any chart Time Range filter: no `WHERE` clause, 4 rows. - Drill to detail with the chart's default filter on `ts`: 4 rows. - Drill to detail with the default filter on another column, or with no chart time filter: 2 rows (correct). Suggested wording below. The real fix is to have `_apply_granularity` drop only the `TEMPORAL_RANGE` it replaces. That changes shared behaviour, so it fits a follow-up PR better, with a test through `QueryContextFactory` using `granularity_sqla` plus a chart `TEMPORAL_RANGE` filter. ```suggestion Drill to detail matches the selected bucket, including a dataset Hours offset, unless the chart also has a Time Range filter on the grained Time Column. Drill by matches the bucket only when the chart has no Time Range filter. Otherwise the query rebuilds its time bounds from the chart or dashboard Time Range, so the drill returns every row in that range. An engine-specific grain without a fixed length matches only the start of the bucket. ``` -- 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]
