mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix: Drill to Detail for Embedded (#39214)
Co-authored-by: Maxime Beauchemin <maximebeauchemin@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit c7955a38ef)
This commit is contained in:
committed by
Michael S. Molina
parent
f0d7945ae9
commit
8a915c4783
@@ -94,13 +94,15 @@ def get_samples( # pylint: disable=too-many-arguments
|
||||
force: bool = False,
|
||||
page: int = 1,
|
||||
per_page: int = 1000,
|
||||
payload: Optional[SamplesPayloadSchema] = None,
|
||||
payload: SamplesPayloadSchema | None = None,
|
||||
dashboard_id: int | None = None,
|
||||
) -> dict[str, Any]:
|
||||
datasource = DatasourceDAO.get_datasource(
|
||||
datasource_type=datasource_type,
|
||||
database_id_or_uuid=str(datasource_id),
|
||||
)
|
||||
|
||||
form_data = {"dashboardId": dashboard_id} if dashboard_id else None
|
||||
limit_clause = get_limit_clause(page, per_page)
|
||||
|
||||
# todo(yongjie): Constructing count(*) and samples in the same query_context,
|
||||
@@ -112,6 +114,7 @@ def get_samples( # pylint: disable=too-many-arguments
|
||||
"id": datasource.id,
|
||||
},
|
||||
queries=[limit_clause],
|
||||
form_data=form_data,
|
||||
result_type=ChartDataResultType.SAMPLES,
|
||||
force=force,
|
||||
)
|
||||
@@ -128,6 +131,7 @@ def get_samples( # pylint: disable=too-many-arguments
|
||||
"id": datasource.id,
|
||||
},
|
||||
queries=[{**payload, **limit_clause}],
|
||||
form_data=form_data,
|
||||
result_type=ChartDataResultType.DRILL_DETAIL,
|
||||
force=force,
|
||||
)
|
||||
@@ -148,6 +152,7 @@ def get_samples( # pylint: disable=too-many-arguments
|
||||
"id": datasource.id,
|
||||
},
|
||||
queries=[{**payload, **count_star_metric} if payload else count_star_metric],
|
||||
form_data=form_data,
|
||||
result_type=ChartDataResultType.FULL,
|
||||
force=force,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user