mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix(Jinja metric macro): Support Drill By and Excel/CSV download without a dataset ID (#30443)
This commit is contained in:
@@ -200,8 +200,8 @@ class TestDatabaseModel(SupersetTestCase):
|
||||
db.session.delete(table)
|
||||
db.session.commit()
|
||||
|
||||
@patch("superset.views.utils.get_form_data")
|
||||
def test_jinja_metric_macro(self, mock_form_data_context):
|
||||
@patch("superset.jinja_context.get_dataset_id_from_context")
|
||||
def test_jinja_metric_macro(self, mock_dataset_id_from_context):
|
||||
self.login(username="admin")
|
||||
table = self.get_table(name="birth_names")
|
||||
metric = SqlMetric(
|
||||
@@ -234,14 +234,8 @@ class TestDatabaseModel(SupersetTestCase):
|
||||
"filter": [],
|
||||
"extras": {"time_grain_sqla": "P1D"},
|
||||
}
|
||||
mock_form_data_context.return_value = [
|
||||
{
|
||||
"url_params": {
|
||||
"datasource_id": table.id,
|
||||
}
|
||||
},
|
||||
None,
|
||||
]
|
||||
mock_dataset_id_from_context.return_value = table.id
|
||||
|
||||
sqla_query = table.get_sqla_query(**base_query_obj)
|
||||
query = table.database.compile_sqla_query(sqla_query.sqla_query)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user