Skip to content

Commit

Permalink
fix: renamed sqllab filters to _filters (apache#14971)
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-jc authored Jun 3, 2021
1 parent 404b3aa commit 6768cb4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
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

0 comments on commit 6768cb4

Please sign in to comment.