dpgaspar commented on code in PR #23853:
URL: https://github.com/apache/superset/pull/23853#discussion_r1206429014
##########
tests/integration_tests/charts/api_tests.py:
##########
@@ -1734,3 +1740,111 @@ def
test_gets_owned_created_favorited_by_me_filter(self):
assert data["result"][0]["slice_name"] == "name0"
assert data["result"][0]["datasource_id"] == 1
+
+ @pytest.mark.usefixtures(
+ "load_energy_table_with_slice",
"load_birth_names_dashboard_with_slices"
+ )
+ def test_warm_up_cache(self):
+ self.login()
+ slc = self.get_slice("Girls", db.session)
+ rv = self.client.put("/api/v1/chart/warm_up_cache", json={"chart_id":
slc.id})
+ self.assertEqual(rv.status_code, 200)
+ data = json.loads(rv.data.decode("utf-8"))
+
+ self.assertEqual(
+ data["result"],
+ [{"chart_id": slc.id, "viz_error": None, "viz_status": "success"}],
+ )
+
+ rv = self.client.put(
+ "/api/v1/chart/warm_up_cache",
+ json={
+ "table_name": "energy_usage",
+ "db_name": get_example_database().database_name,
+ },
+ )
Review Comment:
Seems weird to be warming up cache for a dataset on `/api/v1/chart/...`. The
idea would be to create a new endpoint on dataset's and perhaps use the same
Command, or split it your call. the PUT payload would be restricted to it's
resource
--
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]