xpublish-community / opendap-protocol

A pure Python bare minimum implementation of the OPeNDAP server protocol.
https://opendap-protocol.readthedocs.io
Other
8 stars 2 forks source link

Check in meets_constraint #8

Open bgiebl opened 1 year ago

bgiebl commented 1 year ago

Why is in the meets_constraint() function the constraint only checked if it starts with the value of data_path and not for equality?

https://github.com/MeteoSwiss/opendap-protocol/blob/5d8b1261847c969cfa2eedc2a42b31c84b48035e/opendap_protocol/protocol.py#L551

This leads to a problem for example for a dataset with a dimension with the name 'time' and with a variable with the name 't' (commonly used for temperature). If there is now a DODS request with the constraint string 'time' then meets_constraint will also be true for the variable 't'. So the values of 't' will also appear in the response. Is there a reason why it is not checked for equality in this line? And is there a way to fix this behaviour?