Skip to content
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: renamed sqllab filters to _filters #14971

Merged
merged 2 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,11 @@ There is a special ``_filters`` parameter which can be used to test filters used

.. code-block:: JSON
{
"_filters": {
"_filters": [ {
"col": "action_type",
"op": "IN",
"val": ["sell", "buy"]
} ]
}

.. code-block:: python
Expand Down
3 changes: 2 additions & 1 deletion superset-frontend/src/SqlLab/components/ResultSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ export default class ResultSet extends React.PureComponent<
// before saving the dataset.
if (templateParams) {
const p = JSON.parse(templateParams);
if (p.filters) {
/* eslint-disable-next-line no-underscore-dangle */
if (p._filters) {
/* eslint-disable-next-line no-underscore-dangle */
delete p._filters;
templateParams = JSON.stringify(p);
Expand Down
2 changes: 1 addition & 1 deletion superset/views/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def add_sqllab_custom_filters(form_data: Dict[Any, Any]) -> Any:
if isinstance(params_str, str):
params = json.loads(params_str)
if isinstance(params, dict):
filters = params.get("filters")
filters = params.get("_filters")
if filters:
form_data.update({"filters": filters})
except (TypeError, json.JSONDecodeError):
Expand Down