Repository navigation
Fixes #34279: [Trino] Use model_str for the schema name in cross-database lineage - #34385
Conversation
…ge (open-metadata#34279) EntityReference.name is typed as plain str; calling .root on it raised AttributeError for every run of processCrossDatabaseLineage=true, so the entire cross-database step failed. Replace .root with model_str(), which handles both str and RootModel values safely. Fixes open-metadata#34279 Prepared with AI assistance (Claude Code, Anthropic), reviewed for correctness before submission. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
1 similar comment
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
…test Co-Authored-By: Claude Opus 5.5 <[email protected]>
Head branch was pushed to by a user without write access
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
@harshsoni2024 Updated and rebased cleanly on |
- Fold the three cross-database schema tests into the sibling Trino lineage test file and drop the new file - Model databaseSchema.name as a plain str in the existing cross-database test, matching EntityReference, so it also fails on the old .root access
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ Approved🟡 Medium risk · Converting Trino schema names with model_str() changes cross-database lineage resolution; a wrong value could attach lineage to the wrong schema. Fixes cross-database lineage in Trino by replacing VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Why
Fixes #34279.
TrinoLineageSource._get_cross_database_schema_fqncalled.rootontrino_table.databaseSchema.name, treating it as a PydanticRootModel.EntityReference.nameis typed asOptional[str], not a root model, so every invocation ofprocessCrossDatabaseLineage: trueraised:The entire cross-database lineage step therefore failed for every table, leaving the pipeline as
failed/partialSuccess.What changed
ingestion/src/metadata/ingestion/source/database/trino/lineage.py— one line:model_str(frommetadata.ingestion.ometa.utils) already handles bothstrandRootModelvalues — exactly the right defensive wrapper here.Tests
ingestion/tests/unit/topology/database/test_trino_lineage.py(new file):test_plain_str_name_does_not_raise— parametrised over three schema names; confirms noAttributeErroris raised and the schema name appears in the constructed FQN fallback.test_mapping_entry_returned_verbatim— pre-populated mapping is returned as-is.test_none_schema_name_no_fqn_returns_none— bothdatabaseSchemaandfullyQualifiedNameabsent →None.Prepared with AI assistance (Claude Code, Anthropic), reviewed for correctness before submission.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the previous test concern is fixed and no new actionable issues were found.Summary
Fixes Trino cross-database lineage by using
model_str()instead of reading.rootfromdatabaseSchema.name.Reviews (2) · Last reviewed commit: "fix(trino): sort imports and assert the ..." · Reviewed by Greptile