Skip to content

Commit

Permalink
fix: incorrect filter operator emitted by Filter Box (apache#10421)
Browse files Browse the repository at this point in the history
* fix: equals operator in filter box

* fix time range endpoint schema

* fix test

* bump packages

* fix tests

* lint
  • Loading branch information
villebro committed Jul 26, 2020
1 parent 5d77378 commit 9e0f584
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion superset-frontend/package.json
Expand Up @@ -94,7 +94,7 @@
"@superset-ui/plugin-chart-table": "^0.14.11",
"@superset-ui/plugin-chart-word-cloud": "^0.14.9",
"@superset-ui/preset-chart-xy": "^0.14.9",
"@superset-ui/query": "^0.14.12",
"@superset-ui/query": "^0.14.15",
"@superset-ui/style": "^0.14.9",
"@superset-ui/superset-ui": "^0.14.9",
"@superset-ui/time-format": "^0.14.9",
Expand Down
Expand Up @@ -33,7 +33,7 @@ describe('getEffectiveExtraFilters', () => {
},
{
col: '__time_range',
op: '=',
op: '==',
val: ' : 2020-07-17T00:00:00',
},
]);
Expand Down
Expand Up @@ -22,7 +22,7 @@ export default function getEffectiveExtraFilters(filters: DataRecordFilters) {
return Object.entries(filters)
.map(([column, values]) => ({
col: column,
op: Array.isArray(values) ? 'in' : '=',
op: Array.isArray(values) ? 'in' : '==',
val: values,
}))
.filter(filter => filter.val !== null);
Expand Down
2 changes: 1 addition & 1 deletion superset/charts/schemas.py
Expand Up @@ -561,7 +561,7 @@ class ChartDataExtrasSchema(Schema):

time_range_endpoints = fields.List(
fields.String(
validate=validate.OneOf(choices=("INCLUSIVE", "EXCLUSIVE")),
validate=validate.OneOf(choices=("unknown", "inclusive", "exclusive")),
description="A list with two values, stating if start/end should be "
"inclusive/exclusive.",
)
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/query_context.py
Expand Up @@ -19,7 +19,7 @@

QUERY_OBJECTS = {
"birth_names": {
"extras": {"where": "", "time_range_endpoints": ["INCLUSIVE", "EXCLUSIVE"],},
"extras": {"where": "", "time_range_endpoints": ["inclusive", "exclusive"]},
"granularity": "ds",
"groupby": ["name"],
"is_timeseries": False,
Expand Down

0 comments on commit 9e0f584

Please sign in to comment.