Skip to content

feat: limit too big filters - #216

Open
LionelZoubritzky-IGN wants to merge 2 commits into
mainfrom
151/reject-big-filters
Open

LionelZoubritzky-IGN wants to merge 2 commits into
mainfrom
151/reject-big-filters

Conversation

@LionelZoubritzky-IGN

@LionelZoubritzky-IGN LionelZoubritzky-IGN commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Reject any query that requires a too-big CQL filter ("too big" is at 2 MiB, checked experimentally).

Related issues (if applicable)

Close #151, close #215.

Motivation

Too big filters lead to timeout or to silently wrong answers (see #215).

Implementation

Check the size of the intersect_feature_filter and reject it if too large with a clear error message. Also guard against too large CQL filters in general (which could result from a too-large where clause as well).

The filter never silently switches to the -CARTO-PE version because the id can change: departement.72 does not mean the same thing in ADMINEXPRESS-COG.LATEST and in ADMINEXPRESS-COG-CARTO-PE.LATEST. However, the error message gives a hint to the LLM that it should use the -CARTO-PE version.

Testing

npm run build && npm run verify: 611+4+35 tests green and "how many buildings in Vendée" correctly returns around 840000.

Checklist

  • The PR is focused and of a reasonable size.
  • The commit history is clean.
  • Relevant documentation has been updated.
  • Relevant tests have been added or updated.

@LionelZoubritzky-IGN
LionelZoubritzky-IGN marked this pull request as ready for review October 13, 2026 09:00
@LionelZoubritzky-IGN LionelZoubritzky-IGN changed the title feat: limit too big filters and map to "COG-PE" variant where possible feat: limit too big filters Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant