Skip to content

Sanitize geomcolname #769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 14, 2025

Conversation

danielsparing
Copy link
Contributor

What I am changing

Fix sanity check of geom_col_name to actually check the whole string.

How I did it

re.match(re_match) was matching any string containing any [a-zA-Z] character, regardless of the rest.
The solution is re.fullmatch(). Another way would have been to append r"^...$" to the beginning and end of re_match.

How you can test it

Wrote test test_sanitize_column_name().

Related Issues

Closes #768

In general, the issue of hardcoded-sql-expression is still out there.

@kylebarron
Copy link
Member

Oh those CI failures are unrelated because we don't pin a single version of ruff. I'll bump the ruff version in a separate PR

@kylebarron kylebarron enabled auto-merge (squash) March 14, 2025 15:49
@kylebarron kylebarron merged commit 3fe5ef0 into developmentseed:main Mar 14, 2025
5 checks passed
@kylebarron
Copy link
Member

Thanks!

@danielsparing danielsparing deleted the sanitize-geomcolname branch March 14, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] duckdb geom_col_name not actually sanity checked
2 participants