bito-code-review[bot] commented on code in PR #43810:
URL: https://github.com/apache/superset/pull/43810#discussion_r3927445351


##########
tests/unit_tests/examples/utils_test.py:
##########
@@ -207,6 +218,23 @@ def test_load_examples_from_configs_defaults(
     mock_command.run.assert_called_once()
 
 
+def test_echarts_timeseries_yaml_examples_use_x_axis_metadata() -> None:
+    """ECharts time-series examples must set the temporal column on x_axis."""
+    examples_root = Path(__file__).resolve().parents[3] / "superset" / 
"examples"
+    stale_charts: list[str] = []
+
+    for chart_path in sorted(examples_root.glob("**/charts/*.yaml")):
+        with chart_path.open() as chart_file:
+            chart = yaml.safe_load(chart_file)
+
+        params = chart.get("params") or {}
+        viz_type = chart.get("viz_type") or params.get("viz_type")
+        if viz_type in ECHARTS_TIMESERIES_VIZ_TYPES and "granularity" in 
params:

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Test checks wrong key</b></div>
   <div id="fix">
   
   The test checks `"granularity" in params`, but the example charts store the 
temporal column under `granularity_sqla` (e.g. `Revenue_by_Deal_Size.yaml`, 
`Messages_per_Channel.yaml`). `granularity` never appears in these files, so 
`stale_charts` is always empty and the test passes vacuously, missing the 5 
stale charts it intends to catch. Check `granularity_sqla` instead.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #4cf9c8</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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