-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(explore): Fix chart standalone URL for report/thumbnail generation #20673
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,15 +123,6 @@ def test_dashboard_endpoint(self): | |
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") | ||
def test_slice_endpoint(self): | ||
self.login(username="admin") | ||
slc = self.get_slice("Girls", db.session) | ||
resp = self.get_resp("/superset/slice/{}/".format(slc.id)) | ||
assert "Original value" in resp | ||
assert "List Roles" in resp | ||
|
||
# Testing overrides | ||
resp = self.get_resp("/superset/slice/{}/?standalone=true".format(slc.id)) | ||
assert '<div class="navbar' not in resp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if this is false now, what's the current value? Do we still have a standalone url without the nav? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that now that Explore is in the SPA, the response doc just contains the SPA wrapper. I was assuming that
So, it seemed like these tests don't test anything meaningful anymore, with the exception of the 404 test below. I looked around for examples of backend tests for Dashboard, but didn't see much and assumed they had also been removed when Dashboard was brought into the SPA. |
||
|
||
resp = self.client.get("/superset/slice/-1/") | ||
assert resp.status_code == 404 | ||
|
||
|
@@ -881,7 +872,7 @@ def test_user_activity_access(self, username="gamma"): | |
|
||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") | ||
def test_slice_id_is_always_logged_correctly_on_web_request(self): | ||
# superset/explore case | ||
# explore case | ||
self.login("admin") | ||
slc = db.session.query(Slice).filter_by(slice_name="Girls").one() | ||
qry = db.session.query(models.Log).filter_by(slice_id=slc.id) | ||
|
@@ -1424,7 +1415,7 @@ def test_feature_flag_serialization(self): | |
"/superset/welcome", | ||
f"/superset/dashboard/{dash_id}/", | ||
"/superset/profile/admin/", | ||
f"/superset/explore/table/{tbl_id}", | ||
f"/explore/?dataset_type=table&dataset_id={tbl_id}", | ||
] | ||
for url in urls: | ||
data = self.get_resp(url) | ||
|
@@ -1566,7 +1557,7 @@ def test_explore_injected_exceptions(self, mock_db_connection_mutator): | |
exception = SupersetException("Error message") | ||
mock_db_connection_mutator.side_effect = exception | ||
slice = db.session.query(Slice).first() | ||
url = f"/superset/explore/?form_data=%7B%22slice_id%22%3A%20{slice.id}%7D" | ||
url = f"/explore/?form_data=%7B%22slice_id%22%3A%20{slice.id}%7D" | ||
|
||
self.login() | ||
data = self.get_resp(url) | ||
|
@@ -1576,7 +1567,7 @@ def test_explore_injected_exceptions(self, mock_db_connection_mutator): | |
exception = SQLAlchemyError("Error message") | ||
mock_db_connection_mutator.side_effect = exception | ||
slice = db.session.query(Slice).first() | ||
url = f"/superset/explore/?form_data=%7B%22slice_id%22%3A%20{slice.id}%7D" | ||
url = f"/explore/?form_data=%7B%22slice_id%22%3A%20{slice.id}%7D" | ||
|
||
self.login() | ||
data = self.get_resp(url) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the boolean type can be implicitly converted to string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this one the implicit conversion to
True
was part of why the URL wasn't working: the frontend expected it to be lowercase, so I wanted to make that explicit. But, I did update the frontend so if others use implicit conversion from Pythonbool
it should work!