Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bound filter property is required #225

Open
armanaxh opened this issue Jun 17, 2020 · 0 comments · May be fixed by #227
Open

Bound filter property is required #225

armanaxh opened this issue Jun 17, 2020 · 0 comments · May be fixed by #227

Comments

@armanaxh
Copy link

armanaxh commented Jun 17, 2020

It is not required to fill all property in the druid bound filter. However, if we want to use ‌the Filter base class, we have this problem. We do not have this problem when using the ‌Band filter class.

https://druid.apache.org/docs/latest/querying/filters.html#bound-filter

client.groupby(
    datasource='cafebazaar.tmp_datasource',
    granularity=granularity,
    intervals=date_range,
    aggregations={'count': longsum('count')},
    filter=Filter(type='bound', dimension='count', lower='1', upper='10'),
    ).result
pydruid/pydruid/utils/filters.py in __init__(self, extraction_function, ordering, **args)
     81                     "dimension": args["dimension"],
     82                     "lower": args["lower"],
---> 83                     "lowerStrict": args["lowerStrict"],
     84                     "upper": args["upper"],
     85                     "upperStrict": args["upperStrict"],
KeyError: 'lowerStrict'

After reading the code, I realized that I should use the ‌Band class directly and not the Filter base class, but if we want to use the filter class directly, we will have the problem that all the property is required(Like me). ‌

@MSadeghzadehG @john-bodley
What is your opinion about the solution to this? Limit the usage of Filter class and force using the child classes? Or fix the Filter class and write a test for it?

This was referenced Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant