fix: quote qualified Postgres table identifiers#498
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
a10ff30 to
c83da81
Compare
|
Updated in |
yodakanohoshi
left a comment
There was a problem hiding this comment.
Thanks for the follow-up on this one, @Photon101! 🙌
This is the right finishing touch for #442 — the helper trio
(_split_qualified / _qualified_ident / _with_relation_suffix)
cleans up every call site, and you caught the subtle bit that
ALTER TABLE ... RENAME TO only accepts a bare relation on the RHS.
Test coverage across upsert / replace / swap / row_count is exactly
what was asked for.
I'll add a CHANGELOG entry post-merge — no action needed from your side.
The MySQL / ClickHouse audit listed in #442's "Proposed Approach" is
out of scope for this PR and works well as a separate follow-up issue.
If you'd be interested in tackling it, I'd be glad to open one with
the scope written up — entirely no pressure, this PR stands on its own.
Thanks again for the contribution!
Closes #442.
Summary
schema.tablenames and composepsycopg2.sql.Identifierwith separate schema/relation partsmarketing.email_eventsbecomesmarketing.email_events__drt_swap, not a single quoted identifierValidation
uv run --extra dev --extra postgres python -m pytest tests/unit/test_postgres_destination.py tests/unit/test_dry_run_row_count.py tests/unit/test_dry_run_summary.py -vuv run --extra dev --extra postgres python -m pytest --cov=drt.destinations.postgres --cov-report=term-missing tests/unit/test_postgres_destination.pyuv run --extra dev --extra postgres ruff check drt/destinations/postgres.py tests/unit/test_postgres_destination.pyuv run --extra dev --extra postgres mypy drt/destinations/postgres.pygit diff --check