Compare commits

...
Author SHA1 Message Date
Elizabeth Thompson 271cdd4564 fix(examples): replace deprecated granularity_sqla in YAML chart configs
Self-review on the prior commit caught that the same slices also ship
as YAML fixtures under examples/usa_births_names/charts and
examples/world_health/charts, loaded unconditionally by
load_examples_from_configs() on every `superset load_examples` run.
Those still used the old granularity_sqla key, so the deprecation
warning would keep firing via that path even after the .py rename.
Mirrors the scope of the merged precedent (apache/superset#43422),
which covered both the .py and .yaml sides of the same pattern.
2026-08-23 16:08:09 +00:00
Elizabeth Thompson 2ebddb2e98 fix(examples): replace deprecated granularity_sqla with granularity
Superset.common.query_object.DEPRECATED_FIELDS logs a warning and
performs a runtime migration whenever granularity_sqla is present in
form_data. The birth_names and world_bank example datasets still
seeded slices using the old field name, triggering this warning on
every load. get_slice_json() is a plain dict merge with no schema
validation, so the rename is a straight drop-in with no behavior
change once the examples are (re)loaded.
2026-08-23 16:04:18 +00:00
22 changed files with 28 additions and 28 deletions
+7 -7
View File
@@ -176,7 +176,7 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
"compare_lag": "10",
"compare_suffix": "o10Y",
"limit": "25",
"granularity_sqla": "ds",
"granularity": "ds",
"groupby": [],
"row_limit": current_app.config["ROW_LIMIT"],
"time_range": "100 years ago : now",
@@ -213,7 +213,7 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
params=get_slice_json(
defaults,
viz_type="big_number",
granularity_sqla="ds",
granularity="ds",
compare_lag="5",
compare_suffix="over 5Y",
metric=metric,
@@ -237,7 +237,7 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
defaults,
viz_type="echarts_timeseries_line",
groupby=["name"],
granularity_sqla="ds",
granularity="ds",
rich_tooltip=True,
show_legend=True,
metrics=metrics,
@@ -420,7 +420,7 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
}
],
metrics_b=["sum__num"],
granularity_sqla="ds",
granularity="ds",
yAxisIndex=0,
yAxisIndexB=1,
),
@@ -474,7 +474,7 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
"label": "SUM(num_california)",
},
viz_type="big_number_total",
granularity_sqla="ds",
granularity="ds",
),
editors=[],
),
@@ -496,7 +496,7 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
}
],
viz_type="echarts_timeseries_line",
granularity_sqla="ds",
granularity="ds",
groupby=["name"],
series_limit_metric={
"expressionType": "SIMPLE",
@@ -542,7 +542,7 @@ def create_slices(tbl: SqlaTable) -> tuple[list[Slice], list[Slice]]:
defaults,
metric=metric,
viz_type="big_number_total",
granularity_sqla="ds",
granularity="ds",
adhoc_filters=[gen_filter("gender", "girl")],
subheader="total female participants",
),
@@ -28,7 +28,7 @@ params:
subject: gender
compare_lag: '10'
compare_suffix: o10Y
granularity_sqla: ds
granularity: ds
groupby: []
limit: '100'
markup_type: markdown
@@ -28,7 +28,7 @@ params:
subject: gender
compare_lag: '10'
compare_suffix: o10Y
granularity_sqla: ds
granularity: ds
groupby:
- name
limit: '25'
@@ -22,7 +22,7 @@ description: null
params:
compare_lag: '10'
compare_suffix: o10Y
granularity_sqla: ds
granularity: ds
groupby:
- gender
limit: '25'
@@ -30,7 +30,7 @@ params:
subject: state
compare_lag: '10'
compare_suffix: o10Y
granularity_sqla: ds
granularity: ds
groupby:
- state
limit: '25'
@@ -28,7 +28,7 @@ params:
subject: gender
compare_lag: '10'
compare_suffix: o10Y
granularity_sqla: ds
granularity: ds
groupby: []
limit: '100'
markup_type: markdown
@@ -28,7 +28,7 @@ params:
subject: gender
compare_lag: '10'
compare_suffix: o10Y
granularity_sqla: ds
granularity: ds
groupby:
- name
limit: '25'
@@ -22,7 +22,7 @@ description: null
params:
compare_lag: '5'
compare_suffix: over 5Y
granularity_sqla: ds
granularity: ds
groupby: []
limit: '25'
markup_type: markdown
@@ -22,7 +22,7 @@ description: null
params:
compare_lag: '10'
compare_suffix: o10Y
granularity_sqla: ds
granularity: ds
groupby: []
groupbyColumns:
- state
@@ -29,7 +29,7 @@ params:
compare_lag: '10'
compare_suffix: o10Y
comparison_type: values
granularity_sqla: ds
granularity: ds
groupby:
- name
limit: 10
@@ -29,7 +29,7 @@ params:
compare_lag: '10'
compare_suffix: o10Y
comparison_type: values
granularity_sqla: ds
granularity: ds
groupby:
- name
limit: 10
@@ -22,7 +22,7 @@ description: null
params:
compare_lag: '10'
compare_suffix: o10Y
granularity_sqla: ds
granularity: ds
groupby:
- name
limit: '25'
+1 -1
View File
@@ -154,7 +154,7 @@ def create_slices(tbl: BaseDatasource) -> list[Slice]:
"compare_lag": "10",
"compare_suffix": "o10Y",
"limit": "25",
"granularity_sqla": "year",
"granularity": "year",
"groupby": [],
"row_limit": current_app.config["ROW_LIMIT"],
"since": "2014-01-01",
@@ -24,7 +24,7 @@ params:
compare_suffix: o10Y
country_fieldtype: cca3
entity: country_code
granularity_sqla: year
granularity: year
groupby:
- region
limit: '25'
@@ -24,7 +24,7 @@ params:
compare_suffix: o10Y
country_fieldtype: cca3
entity: country_code
granularity_sqla: year
granularity: year
groupby:
- country_name
limit: '25'
@@ -43,7 +43,7 @@ params:
subject: country_code
color_scheme: supersetColors
entity: country_name
granularity_sqla: year
granularity: year
legendOrientation: top
legendType: scroll
max_bubble_size: '50'
@@ -24,7 +24,7 @@ params:
compare_suffix: o10Y
country_fieldtype: cca3
entity: country_code
granularity_sqla: year
granularity: year
groupby:
- country_name
limit: '25'
@@ -24,7 +24,7 @@ params:
compare_suffix: o10Y
country_fieldtype: cca3
entity: country_code
granularity_sqla: year
granularity: year
groupby: []
limit: '25'
markup_type: markdown
@@ -27,7 +27,7 @@ params:
compare_suffix: o10Y
country_fieldtype: cca3
entity: country_code
granularity_sqla: year
granularity: year
groupby: []
limit: '25'
markup_type: markdown
@@ -24,7 +24,7 @@ params:
compare_suffix: o10Y
country_fieldtype: cca3
entity: country_code
granularity_sqla: year
granularity: year
groupby:
- region
- country_code
@@ -24,7 +24,7 @@ params:
compare_suffix: o10Y
country_fieldtype: cca3
entity: country_code
granularity_sqla: year
granularity: year
groupby:
- region
limit: '25'
@@ -24,7 +24,7 @@ params:
compare_suffix: over 10Y
country_fieldtype: cca3
entity: country_code
granularity_sqla: year
granularity: year
groupby: []
limit: '25'
markup_type: markdown