Download src/query/ir/operators.py from DataEyond/Agentic-Service-Data-Eyond-Catalog: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog/resolve/717452f69ec32394dea2a8fc11aba47eebe5bc53/src/query/ir/operators.py
- Command line
-
hf download hf://spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog@717452f69ec32394dea2a8fc11aba47eebe5bc53/src/query/ir/operators.py
-
curl -L -o operators.py https://huggingface.co/spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog/resolve/717452f69ec32394dea2a8fc11aba47eebe5bc53/src/query/ir/operators.py
1.02 kB
| """Whitelisted operators + aggregation functions for IR validation.""" | |
| ALLOWED_FILTER_OPS = frozenset({ | |
| "=", "!=", "<", "<=", ">", ">=", | |
| "in", "not_in", "is_null", "is_not_null", | |
| "like", "between", | |
| }) | |
| ALLOWED_AGG_FNS = frozenset({ | |
| "count", "count_distinct", "sum", "avg", "min", "max", | |
| }) | |
| LIMIT_HARD_CAP = 10_000 | |
| # Type compatibility: which value_types may appear in a FilterClause when the | |
| # referenced column has the given data_type. Numeric types are mutually | |
| # compatible (decimal literal against int column is fine). Date/datetime accept | |
| # string so the planner can emit ISO-8601 literals without mode juggling. | |
| TYPE_COMPATIBILITY: dict[str, frozenset[str]] = { | |
| "int": frozenset({"int", "decimal"}), | |
| "decimal": frozenset({"int", "decimal"}), | |
| "string": frozenset({"string"}), | |
| "datetime": frozenset({"datetime", "date", "string"}), | |
| "date": frozenset({"date", "datetime", "string"}), | |
| "bool": frozenset({"bool"}), | |
| "json": frozenset({"string"}), | |
| } | |