Open vlad-ignatov opened 4 days ago
I think a lot of this is coming down to differences in the database implementation - I had to do the date cast in a slightly different way than it works in postgres, but I have something that is working locally.
Can you provide specific URLs for the other broken filters?
@vlad-ignatov pinging on this from the meeting - dates are fixed, just get me urls for other broken filters.
I don't see the dates being fixed. There are too many errors and this is hard to test. Let me lis a few errors, and I'll test again after you fix them.
Using https://api.smartcumulus.org/data-packages/data_metrics__count_c_system_use_observation_code__001/chart
as base url, these are some queries that fail for me:
?column=year&filter=year%3AafterYear%3A2000-01-01
?column=year&filter=cnt%3Alt%3A15
- getting bigger numbers than 15?column=year&filter=cnt%3Alte%3A25
- getting bigger numbers than 15?column=year&filter=cnt%3Agt%3A100000000
- returns no data but without the filter I can see counts above 100M?column=year&filter=cnt%3AstrContains%3A3
- looks like contains cannot be used on cnt
?column=year&stratifier=site&filter=site%3Amatches%3Auc_davis
?column=year&stratifier=site&filter=site%3AstrNotContainsCI%3Auc_davis
@vlad-ignatov ok - looks like this is cumulus__none
related, which is odd since i copied the last_valid version of this file to the dev aggregator, but didn't end up with that value in dev.
I know you've got them split out in some way at the dashboard layer - do you want cumulus_none
value in the query block itself, or returned as a separate part of the response?
Not sure what the exact error is since I only see the generic error messages. Example:
https://api.smartcumulus.org/data-packages/data_metrics__count_c_system_use_observation_code__001/chart?column=year&filter=year%3AafterYear%3A2000-01-01
It looks like you are expecting just the year number here. The question is, for compatibility reasons, can you accept
YYYY-MM-DD
and extract the info from it? (applies to all date filters)Other filters that do not seem to work correctly:
<
and<=
(eg.:cnt < 10000
)The filter implementation can be very tricky. Keep in mind that at the database level, all columns other than cnt, regardless of their data type are stored as text (to allow cumulus__none and other custom values). Then string operators and filters are also applicable to non-string columns. As a reference, here is the relevant part of the dashboard's current filter implementation: