pacificclimate / pdp_util

A package supplying numerous apps for running PCIC's data server
GNU General Public License v3.0
0 stars 0 forks source link

Database queries use incorrect method to discriminate climatological variables #50

Closed rod-glover closed 8 months ago

rod-glover commented 1 year ago

The test (roughly rendered) cell_methods ~ '(within|over)' no longer gives correct results. Instead we must use (rendered as SQL)

ARRAY['climatology'::text] <@ variable_tags(meta_vars.*)

or its complement

ARRAY['observation'::text] <@ variable_tags(meta_vars.*)

Problematic queries:

https://github.com/pacificclimate/pdp_util/blob/916761ff920b9071801156a806cf1ebc4b4e67e4/pdp_util/agg.py#L122 https://github.com/pacificclimate/pdp_util/blob/916761ff920b9071801156a806cf1ebc4b4e67e4/pdp_util/filters.py#L176 https://github.com/pacificclimate/pdp_util/blob/916761ff920b9071801156a806cf1ebc4b4e67e4/pdp_util/pcds_index.py#L189 https://github.com/pacificclimate/pdp_util/blob/916761ff920b9071801156a806cf1ebc4b4e67e4/tests/test_filters.py#L66