mikebridge commented on code in PR #44270:
URL: https://github.com/apache/superset/pull/44270#discussion_r4048099910
##########
tests/unit_tests/mcp_service/semantic_layer/tool/test_get_table.py:
##########
@@ -106,6 +113,154 @@ def _make_view(view_id: int = 5) -> MagicMock:
return view
[email protected]
+def temporal_view() -> Generator[MagicMock, None, None]:
+ """Resolve a view with a temporal dimension and three queryable grains."""
+ view: MagicMock = _make_view()
+ view.columns = [
+ _make_column("metric_time", True),
+ _make_column("country_name"),
+ ]
+ view.get_time_grains.return_value = [
+ {"duration": "P1D", "name": "Day"},
+ {"duration": "P1W", "name": "Week"},
+ {"duration": "P1M", "name": "Month"},
+ ]
+ view.implementation.get_dimensions.return_value = [
+ Dimension(
+ id=f"metric_time__{grain.name}",
+ name="metric_time",
+ type=pa.timestamp("us"),
+ grain=grain,
+ )
+ for grain in (Grains.DAY, Grains.WEEK, Grains.MONTH)
+ ]
Review Comment:
Addressed in
[ea94f09381](https://github.com/apache/superset/commit/ea94f09381b4784f0dc96cac4dd4e5a21458e453)
— added both grain=None dimensions to the fixture. Removing the guard produces
13 failures; restoring it passes all 434 semantic-layer/utils tests.
--
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]