Skip to content

Quoted and Capitalised table names handling#186

Merged
whimo merged 1 commit into
mainfrom
aivan/2026-06-17-Capital-Postgres-table-name-fix
Jun 17, 2026
Merged

Quoted and Capitalised table names handling#186
whimo merged 1 commit into
mainfrom
aivan/2026-06-17-Capital-Postgres-table-name-fix

Conversation

@AivanF

@AivanF AivanF commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Improved live table lookup to correctly resolve schema-qualified names and double-quoted identifiers, including quoted/escaped identifier forms.
  • Tests

    • Added unit tests for identifier quote stripping and live-table resolution, covering quoted, unquoted, whitespace, escaped quotes, unbalanced quotes, and missing tables.
  • Chores

    • Bumped the package version to 0.7.5.

@AivanF AivanF requested a review from whimo June 17, 2026 18:45
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 96f68ae2-e29d-4afd-a49e-10ba5f091149

📥 Commits

Reviewing files that changed from the base of the PR and between 88d0b63 and ff2eddd.

📒 Files selected for processing (3)
  • pyproject.toml
  • slayer/engine/schema_drift.py
  • tests/test_validate_models.py
✅ Files skipped from review due to trivial changes (1)
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • slayer/engine/schema_drift.py
  • tests/test_validate_models.py

📝 Walkthrough

Walkthrough

Adds _strip_ident_quotes() to unescape SQL double-quoted identifiers and updates _resolve_live_table() to resolve sql_table values against the introspected live tables map using multiple candidate names (qualified, bare, and unquoted variants). Unit tests cover both helpers. Package version is bumped to 0.7.5.

Changes

Schema drift: quoted identifier resolution

Layer / File(s) Summary
_strip_ident_quotes and _resolve_live_table implementation
slayer/engine/schema_drift.py
Adds _strip_ident_quotes(ident) to remove surrounding double quotes and unescape "" sequences. Extends _resolve_live_table() to build a candidate list of full qualified, bare table, and both unquoted variants before checking the live tables introspection map.
Unit tests for both helpers
tests/test_validate_models.py
Imports both internal helpers for direct testing. TestStripIdentQuotes covers bare names, quoted identifiers, escaped inner quotes, unbalanced quotes, and whitespace. TestResolveLiveTable covers bare lookup, schema-qualified fallback, quoted parts, and the None path.
Version bump
pyproject.toml
Updates project version from 0.7.4 to 0.7.5.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A quote here, a quote there,
Double "" floating in the air,
The schema lookup peeks inside,
Strips the wrapper, checks each side —
No table hides from this bunny's eye! 🔍

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Quoted and Capitalised table names handling' directly relates to the main change: adding support for schema-qualified and double-quoted identifiers in live table lookup, with comprehensive test coverage for quote-stripping and identifier resolution.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aivan/2026-06-17-Capital-Postgres-table-name-fix

Comment @coderabbitai help to get the list of available commands and usage tips.

@AivanF AivanF changed the title Capital Postgres table name fix Quoted and Capitalised table names handling Jun 17, 2026
@AivanF AivanF force-pushed the aivan/2026-06-17-Capital-Postgres-table-name-fix branch from 88d0b63 to ff2eddd Compare June 17, 2026 18:59
@sonarqubecloud

Copy link
Copy Markdown

@whimo whimo merged commit 6f32616 into main Jun 17, 2026
6 checks passed
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.

2 participants