-
Notifications
You must be signed in to change notification settings - Fork 4
feat: refactor location CTE for materialized views and enhance path validation #547
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||||||||||
| import os | ||||||||||||||
| import re | ||||||||||||||
| import textwrap | ||||||||||||||
| from importlib.util import find_spec | ||||||||||||||
| from pathlib import Path | ||||||||||||||
|
|
@@ -182,6 +183,21 @@ def _mount_path() -> str: | |||||||||||||
|
|
||||||||||||||
| # Remove any trailing slashes so "/ogcapi/" and "ogcapi/" both become "/ogcapi". | ||||||||||||||
| path = path.rstrip("/") | ||||||||||||||
|
|
||||||||||||||
|
||||||||||||||
| # After stripping trailing slashes, treat an empty path as invalid and | |
| # fall back to the default, consistent with the earlier check. | |
| if not path: | |
| path = "/ogcapi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LATEST_LOCATION_CTEis a reusable SELECT body that gets embedded insideWITH latest_location AS (...), but it is not itself a full CTE (it has nolatest_location AS (...)wrapper). Renaming to something likeLATEST_LOCATION_SELECT/LATEST_LOCATION_QUERYwould make its intent clearer when reading the f-string SQL blocks.