Repository navigation
fix(glue): keep column lineage when storage displayName is null, iceberg partition key - #34194
Conversation
… unreachable Iceberg partition-key filter Fixes open-metadata/openmetadata-collate#5947 Fixes open-metadata/openmetadata-collate#5949 External-table lineage matched storage columns on displayName alone. Storage connectors list partition columns first and leave their displayName unset, so the first comparison raised and the loop-wide except dropped every column edge, keeping only the table-level one. Match on displayName or, when it is unset, the column name; resolve a matched column without an FQN to nothing; and resolve each column in its own try so a failure costs only its own edge. The mixin is shared, so the Athena, Databricks, Unity Catalog metadata, Snowflake and Redshift sources get the same fix. Glue rejects parameters on partition keys, and Iceberg's Glue catalog writes iceberg.field.current only on StorageDescriptor.Columns, so the retired-field check on PartitionKeys could never fire. Apply it to regular columns only and always emit partition keys.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
✅ Playwright Results — workflow succeededValidated commit ✅ 105 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 49m 0s ⏱️ Max setup 5m 16s · max shard execution 14m 56s · max shard-job elapsed before upload 20m 31s · reporting 4s 🌐 252.38 requests/attempt · 1.82 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ Approved🟡 Medium risk · Shared lineage matching changes behavior across multiple ingestion connectors. Fixes column lineage loss when storage OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
🚦 Removed from the merge queue —
|



Describe your changes:
Fixes open-metadata/openmetadata-collate#5947
Fixes open-metadata/openmetadata-collate#5949
Two Glue fixes from the 2.1 epic. They are bundled because both are small, both are in Glue's column path, and both are tested in
test_glue.py.#5947: column lineage to a storage container is dropped when a storage column has no
displayName.ExternalTableLineageMixin._get_data_model_column_fqncalledentity_column.displayName.lower()with no null check._get_column_lineagewrapped the whole loop in onetry, and itsexceptreturnedNone.The null is routine.
StorageServiceSource._partition_columns_to_table_columnsbuilds partition columns without adisplayName, and_get_columnslists them first (partition_cols + extracted_cols). So on any partitioned container the first comparison raised, and the edge went out withcolumnsLineage=None, meaning table-level lineage only. The server never fills in a columndisplayNameeither, andColumnRepositorysets it to null when a user clears it.displayName, and on the column name whendisplayNameis unset. Matching stays case-insensitive.displayNameis still checked first, so every match that works today still works..root.try, so a failure costs only that column's edge, and the function always returns a list.The mixin is shared, so the Athena, Databricks, Unity Catalog metadata, Snowflake and Redshift sources get the same fix. It is generic null-safety, not connector-specific behaviour.
#5949:
_iter_columnsreadiceberg.field.currentfromPartitionKeys.Nothing can produce that data:
IcebergToGlueConverter, the only writer of the flag, sets it onStorageDescriptor.Columnsand never setsPartitionKeysat all. Every field, partition sources included, is written toStorageDescriptor.Columns, and that is where a retired field is flagged.athena/utils.py) already reads the flag fromStorageDescriptor.Columnsonly.The retired-field filter now runs over regular columns only, and partition keys are always emitted.
test_retired_partition_key_is_droppedis replaced, because its payload is one Glue refuses. This removes the branch #33850 carried over from the oldget_tablepath.Type of change:
High-level design:
N/A, small change (4 files). The one cross-cutting point is covered above: the #5947 fix lives in the shared
ExternalTableLineageMixin. The blast-radius run below shows no behaviour change for the mixin's other users.Tests:
Use cases covered
displayNamegets column edges for the partition column and the regular column. Before, it got neither.Regionin storage matchesregionin Glue).GlueSource:yield_tableon a partitioned table with ans3a://location fills the location map.yield_external_table_lineagethen emits a container→table edge whose column lineage includes the partition key.Unit tests
ingestion/tests/unit/topology/database/test_glue.pyTestGlueExternalTableColumnLineage(5 tests). Each test asserts theAddLineageRequestthe source emits, not the helper's return value. Only the two ES lookups (es_search_container_by_path,es_search_from_fqn) are stubbed.TestGlueIcebergRetiredColumns,test_retired_partition_key_is_droppedis replaced bytest_partition_keys_of_an_iceberg_table_are_kept. The test helper now builds partition keys as Glue returns them, with noParameters.main, where the edge is emitted with empty column lineage, and pass with the fix. The [Snyk] Security upgrade moment from 2.29.1 to 2.29.4 #5949 test passes on both. That is expected, since the removed branch had no observable effect on any payload Glue accepts.test_glue.py):external_table_lineage_mixin.py92%,glue/metadata.py87%. Every changed line is covered. The mixin's remaining misses (lines 89-91, 98) are lines this PR does not touch.test_glue.py: 113 passed, 2 failed. The 2 failures reproduce identically onmain:GlueUnitTest::test_database_schema_namesand…_filters_other_catalogs_before_schema_filter. They come from an existing order dependency._custom_db_name_source(added in fix(glue): stop a custom databaseName dropping every schema #31958) leavesdatabase=NEW_DBin the process-wide topology context. Both tests pass in isolation.sql_lineagesuites onmainand on this branch. The failure and error sets are identical, and all come from optional connector dependencies that are missing locally. Passes went from 336 to 340. Withpyathenainstalled,test_athena.pyandtest_athena_utils.pypass 60/60 on both, includingtest_column_lineage, which calls_get_column_lineagedirectly.ruff check,ruff format --checkandcheck_ruff_suppressions.py --checkare clean. One G004 baseline entry is pruned, because the rewritten logger call now uses lazy formatting. basedpyright, scoped tosrcas in CI, reports 0 errors on the changed files.Backend integration tests
Ingestion integration tests
GlueSourceand the real pydantic models. An integration test would need a live Glue catalog and an S3 storage service, which CI does not have.Playwright (UI) tests
Manual testing performed
No live AWS run. The end-to-end path through the real
GlueSource.yield_tableandyield_external_table_lineagewas exercised with only the two ES lookups stubbed (test_a_partitioned_glue_table_gets_an_edge_for_its_partition_key):event_id, partition keydt, locations3a://bucket/events) goes throughyield_table.dthas nodisplayName.columnsLineage. After: the same edge carryingdt → dtandevent_id → event_id.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>. The title uses thefix(glue): …form of fix(glue): read Glue Iceberg flags from GetTables, emit decimal precision/scale #33850, fix(glue): populate viewDefinition for Glue views #33573 and fix(glue): ingest AWS Glue table parameters as custom properties #33333 instead, because both issues are in the collate repo.Fixes …above (fullowner/repo#form).