mirror of https://github.com/apache/superset.git
fix: renamed sqllab filters to _filters (#14971)
This commit is contained in:
parent
765e9dd932
commit
f652908a70
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue