Missing space in VariableFilter where clause construction
Closed this issue · 4 comments
andy-esch commented
If we add a space before the AND
it might take care of an error I get when trying to apply two VariableFilters:
[{'reason': 'invalidQuery', 'location': 'query', 'message': 'Syntax error: Missing whitespace between literal and alias at [32:65]'}]
Here's my code:
enriched_data = enrich.enrich_polygons(
polys,
variables=dataset_vars,
filters=[
VariableFilter(
Variable.get("date_range_star_d1bbce15"), "= 1567296000 "
),
VariableFilter(dataset_vars[-1], " is not null "),
],
aggregation={dataset_vars[-1].id: "ARRAY_AGG"},
)
If I add spaces around the filter condition in the VariableFilter it works just fine but when I remove the spaces that error shows up.
For example:
# this works
filters=[
VariableFilter(
Variable.get("date_range_star_d1bbce15"), "= 1567296000 "
),
VariableFilter(dataset_vars[-1], " is not null "),
],
# this doesn't work
filters=[
VariableFilter(
Variable.get("date_range_star_d1bbce15"), "= 1567296000"
),
VariableFilter(dataset_vars[-1], "is not null"),
],
simon-contreras-deel commented
🚀 It should be solved. Take into account #1406
cmongut commented
@andy-esch could you check this issue has been solved?
Jesus89 commented
Already solved