-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[cache] Cleaning up viz/cache logic #9375
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 |
---|---|---|
|
@@ -187,7 +187,7 @@ def check_datasource_perms( | |
except SupersetException as e: | ||
raise SupersetSecurityException(str(e)) | ||
|
||
viz_obj = get_viz( | ||
viz_obj = get_viz( # type: ignore | ||
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. This seemed cleaner than doing |
||
datasource_type=datasource_type, | ||
datasource_id=datasource_id, | ||
form_data=form_data, | ||
|
@@ -576,27 +576,6 @@ def clean_fulfilled_requests(session): | |
session.commit() | ||
return redirect("/accessrequestsmodelview/list/") | ||
|
||
def get_viz( | ||
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. Unused since the |
||
self, | ||
slice_id=None, | ||
form_data=None, | ||
datasource_type=None, | ||
datasource_id=None, | ||
force=False, | ||
): | ||
if slice_id: | ||
slc = db.session.query(Slice).filter_by(id=slice_id).one() | ||
return slc.get_viz() | ||
else: | ||
viz_type = form_data.get("viz_type", "table") | ||
datasource = ConnectorRegistry.get_datasource( | ||
datasource_type, datasource_id, db.session | ||
) | ||
viz_obj = viz.viz_types[viz_type]( | ||
datasource, form_data=form_data, force=force | ||
) | ||
return viz_obj | ||
|
||
@has_access | ||
@expose("/slice/<slice_id>/") | ||
def slice(self, slice_id): | ||
|
@@ -2783,19 +2762,6 @@ def sqllab(self): | |
"superset/basic.html", entry="sqllab", bootstrap_data=bootstrap_data | ||
) | ||
|
||
@api | ||
@handle_api_exception | ||
@has_access_api | ||
@expose("/slice_query/<slice_id>/") | ||
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. @mistercrunch double checking that this is legacy/completely unused 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. Just greped in the repo and things look 👍 |
||
def slice_query(self, slice_id): | ||
""" | ||
This method exposes an API endpoint to | ||
get the database query string for this slice | ||
""" | ||
viz_obj = get_viz(slice_id) | ||
security_manager.assert_viz_permission(viz_obj) | ||
return self.get_query_string_response(viz_obj) | ||
|
||
@api | ||
@has_access_api | ||
@expose("/schemas_access_for_csv_upload") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,12 +80,11 @@ def get_permissions(user): | |
|
||
|
||
def get_viz( | ||
slice_id=None, form_data=None, datasource_type=None, datasource_id=None, force=False | ||
form_data: Dict[str, Any], | ||
datasource_type: str, | ||
datasource_id: int, | ||
force: bool = False, | ||
): | ||
if slice_id: | ||
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. Unused after removing the |
||
slc = db.session.query(Slice).filter_by(id=slice_id).one() | ||
return slc.get_viz() | ||
|
||
viz_type = form_data.get("viz_type", "table") | ||
datasource = ConnectorRegistry.get_datasource( | ||
datasource_type, datasource_id, db.session | ||
|
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.
Unused after removing the
/slice_query/<slice_id>/
endpoint.