Skip to content

Honor translated association column names during SQLite reads - #88

Merged
xrotwang merged 2 commits into
cldf:masterfrom
antonsoo:fix/sqlite-association-column-translation
Oct 28, 2026
Merged

xrotwang merged 2 commits into
cldf:masterfrom
antonsoo:fix/sqlite-association-column-translation

Conversation

@antonsoo

Copy link
Copy Markdown
Contributor

Two parts of the SQLite association reader use untranslated names:

  • Renaming the association table's context column makes Database.read() raise OperationalError: no such column: context.
  • Renaming list-valued foreign-key columns leaves extra empty lists under their original names, alongside the correctly translated populated fields. Empty associations have only the wrong names.

Use the existing translator for context in the SQL projection/filter and for the default empty-list keys in TableReadSpec.read_row. This preserves the association schema created by the same translator. Add four regressions covering context renaming and populated/empty lists, asserting the complete output row.

Both full suites pass with 100% configured coverage: Python 3.12 has 835 passes/16 expected failures, and 3.9 has 838 passes/13 expected failures. Changed-file Flake8 passes. A separate CSV/SQLite continuation using published Concepticon labels passes all 192 translation configurations after, versus none before, while all 64 complete controls are unchanged. The installed wheel reproduces the fixed source exactly.

This is based directly on current master and is separate from #87's preservation of whitespace in reference values. A local composition of both changes passes the combined suites (839/16 on 3.12, 842/13 on 3.9) and both relational workflows, including multiword values with all columns renamed. The two patches touch the same small reader section and have a local merge conflict; the combined resolution has been validated.

@xrotwang
xrotwang merged commit 5270661 into cldf:master Oct 28, 2026
5 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