fix(cql2_text): allow single-letter property names - #173
Open
C1-BA-B1-F3 wants to merge 1 commit into
Open
C1-BA-B1-F3 wants to merge 1 commit into
C1-BA-B1-F3 wants to merge 1 commit into
Conversation
The unquoted attribute regex /[a-zA-Z][a-zA-Z_:0-9.]+/ required at least two characters, so expressions like 'a = 1' or 'S_INTERSECTS(g, BBOX(...))' failed to parse. Change the trailing .+ to .* so a single-letter identifier is accepted. Fixes geopython#165
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The unquoted attribute regex in the cql2_text Lark grammar required at least two characters:
So expressions with a single-letter property name like
a = 1orS_INTERSECTS(g, BBOX(...))failed to parse withUnexpectedCharacters.Changing the trailing
.+to.*accepts single-letter identifiers while keeping all existing behaviour.Test plan
test_single_letter_attributeandtest_single_letter_attribute_in_functioncover the fix.pytest tests/parsers/cql2_text/— 50/50 pass.pytest tests/parsers tests/native tests/test_utils.py— 247/247 pass (backend suites requiring optional deps django/osgeo/elasticsearch/sqlalchemy were not run locally; the change is confined to the cql2_text grammar and does not touch backend code).Fixes #165