fix: renamed sqllab filters to _filters (#14971)

This commit is contained in:
cccs-jc 2021-06-03 14:22:50 -04:00 committed by GitHub
parent 765e9dd932
commit f652908a70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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);

View File

@ -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):