Skip to content

Commit

Permalink
fix(data-quality): table diff url (#18221)
Browse files Browse the repository at this point in the history
fixed url for table diff when using service connection
  • Loading branch information
sushi30 authored Oct 10, 2024
1 parent f9e99f4 commit bff5066
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def __init__(self, *args, **kwargs):
}

def get_parameters(self, test_case) -> TableDiffRuntimeParameters:
service1_url = (
str(get_connection(self.service_connection_config).url)
if self.service_connection_config
else None
)
service1: DatabaseService = self.ometa_client.get_by_id(
DatabaseService, self.table_entity.service.id, nullable=False
)
Expand All @@ -58,6 +63,9 @@ def get_parameters(self, test_case) -> TableDiffRuntimeParameters:
table2: Table = self.ometa_client.get_by_name(
Table, fqn=table2_fqn, nullable=False
)
service2_url = (
service1_url if table2.service == self.table_entity.service else None
)
service2: DatabaseService = self.ometa_client.get_by_id(
DatabaseService, table2.service.id, nullable=False
)
Expand All @@ -69,7 +77,9 @@ def get_parameters(self, test_case) -> TableDiffRuntimeParameters:
self.table_entity.fullyQualifiedName.root
),
serviceUrl=self.get_data_diff_url(
service1, self.table_entity.fullyQualifiedName.root
service1,
self.table_entity.fullyQualifiedName.root,
override_url=service1_url,
),
columns=self.filter_relevant_columns(
self.table_entity.columns, key_columns, extra_columns
Expand All @@ -80,7 +90,8 @@ def get_parameters(self, test_case) -> TableDiffRuntimeParameters:
serviceUrl=self.get_data_diff_url(
service2,
table2_fqn,
override_url=self.get_parameter(test_case, "service2Url"),
override_url=self.get_parameter(test_case, "service2Url")
or service2_url,
),
columns=self.filter_relevant_columns(
table2.columns, key_columns, extra_columns
Expand Down

0 comments on commit bff5066

Please sign in to comment.