From b02c64931efb09f9b3b13b9843e15e65fa50d075 Mon Sep 17 00:00:00 2001 From: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Date: Sat, 9 Nov 2024 20:33:32 +0530 Subject: [PATCH] MINOR: Fix table not found error (#18560) --- ingestion/src/metadata/ingestion/lineage/sql_lineage.py | 6 ++++-- ingestion/tests/integration/postgres/test_lineage.py | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ingestion/src/metadata/ingestion/lineage/sql_lineage.py b/ingestion/src/metadata/ingestion/lineage/sql_lineage.py index db2011f3370..0e6e47c7302 100644 --- a/ingestion/src/metadata/ingestion/lineage/sql_lineage.py +++ b/ingestion/src/metadata/ingestion/lineage/sql_lineage.py @@ -341,10 +341,12 @@ def _create_lineage_by_table_name( (to_table, to_table_entities), ): if entity is None: - raise RuntimeError(f"Table entity not found: [{table_name}]") + logger.debug( + f"WARNING: Table entity [{table_name}] not found in OpenMetadata" + ) for from_entity, to_entity in itertools.product( - from_table_entities, to_table_entities + from_table_entities or [], to_table_entities or [] ): if to_entity and from_entity: yield _build_table_lineage( diff --git a/ingestion/tests/integration/postgres/test_lineage.py b/ingestion/tests/integration/postgres/test_lineage.py index fd2c9ca68cc..15aab0f766a 100644 --- a/ingestion/tests/integration/postgres/test_lineage.py +++ b/ingestion/tests/integration/postgres/test_lineage.py @@ -96,9 +96,7 @@ def test_log_lineage( workflow = run_workflow( MetadataWorkflow, log_lineage_config, raise_from_status=False ) - assert len(workflow.source.status.failures) == 2 - for failure in workflow.source.status.failures: - assert "Table entity not found" in failure.error + assert len(workflow.source.status.failures) == 0 customer_table: Table = metadata.get_by_name( Table, f"{db_service.fullyQualifiedName.root}.dvdrental.public.customer",