DM-51789: Add support for looking up column references by name#189
Open
JeremyMcCormick wants to merge 2 commits into
Open
DM-51789: Add support for looking up column references by name#189JeremyMcCormick wants to merge 2 commits into
JeremyMcCormick wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #189 +/- ##
==========================================
+ Coverage 91.89% 92.01% +0.12%
==========================================
Files 13 13
Lines 2060 2116 +56
Branches 299 313 +14
==========================================
+ Hits 1893 1947 +54
- Misses 109 110 +1
- Partials 58 59 +1 ☔ View full report in Codecov by Harness. |
57180f3 to
c435223
Compare
4 tasks
There was a problem hiding this comment.
Pull request overview
Adds name-based resolution of column references across the Felis datamodel and downstream consumers, while preserving backward compatibility with legacy global column IDs.
Changes:
- Introduces name-first column resolution (
Table._find_column) and updates schema validation for constraints/indexes. - Adds
ForeignKeyReferenceto support a name-based foreign key target (reference) alongside legacyreferencedColumns. - Updates SQLAlchemy metadata builder, TAP_SCHEMA loader, and test fixtures to use name-based references.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_metadata.py | Updates metadata assertions to resolve constraint/index column refs via name-first lookup. |
| tests/test_datamodel.py | Adds tests covering name-based lookup for column groups, indexes, and foreign keys (including reference). |
| tests/data/sales.yaml | Migrates fixture constraints to name-based column refs and adds new constraints using reference. |
| python/felis/tap_schema.py | Resolves foreign keys using name-based refs (and legacy fallback) when generating TAP_SCHEMA keys/key_columns rows. |
| python/felis/metadata.py | Switches metadata building to resolve columns by name-first lookup and maps Felis objects to SQLAlchemy objects by identity. |
| python/felis/datamodel.py | Adds ForeignKeyReference, name-first column lookup, FK exclusivity checks, and schema validation for index/constraint refs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
57f1ea6 to
b1950c7
Compare
Copilot stopped work on behalf of
JeremyMcCormick due to an error
July 7, 2026 23:24
02562d5 to
b1950c7
Compare
Copilot stopped work on behalf of
JeremyMcCormick due to an error
July 7, 2026 23:31
0db204b to
32d1a7c
Compare
This partially implements the triggered changes from RFC-1111. The column references in constraints and indexes now support either a name in the current table or an ID for backward compatibility. The `primaryKey` field was left alone for now and will be updated to support names on a separate ticket.
32d1a7c to
f49cb6e
Compare
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.
This updates Felis to support referencing of columns by their name instead of their ID, described in RFC-1111. The ID lookup is also supported for backward compatibility, at least for the deprecation period.
The
primaryKeyfield still uses the ID for now. This will be resolved on a separate PR for DM-46055.Checklist
docs/changes