Skip to content

Commit bdfbbe4

Browse files
committed
address review comments
1 parent a6382f1 commit bdfbbe4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

metadata-ingestion/src/datahub/ingestion/source/looker/view_upstream.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def create_fields(self) -> List[ViewField]:
239239
return [] # it is for the special case
240240

241241
def create_upstream_column_refs(
242-
self, upstream_urn: str, expected_columns: List[str]
242+
self, upstream_urn: str, downstream_looker_columns: List[str]
243243
) -> List[ColumnRef]:
244244
"""
245245
- **`upstream_urn`**: The URN of the upstream dataset.
@@ -258,12 +258,14 @@ def create_upstream_column_refs(
258258
urn, schema_info = schema_resolver.resolve_urn(urn=upstream_urn)
259259

260260
if schema_info:
261-
actual_columns = match_columns_to_schema(schema_info, expected_columns)
261+
actual_columns = match_columns_to_schema(
262+
schema_info, downstream_looker_columns
263+
)
262264
else:
263265
logger.info(
264266
f"schema_info not found for dataset {urn} in GMS. Using expected_columns to form ColumnRef"
265267
)
266-
actual_columns = [column.lower() for column in expected_columns]
268+
actual_columns = [column.lower() for column in downstream_looker_columns]
267269

268270
upstream_column_refs: List[ColumnRef] = []
269271

@@ -417,7 +419,7 @@ def get_upstream_column_ref(
417419
upstream_urn=self._get_upstream_dataset_urn()[
418420
0
419421
], # 0th index has table of from clause,
420-
expected_columns=field_context.column_name_in_sql_attribute(),
422+
downstream_looker_columns=field_context.column_name_in_sql_attribute(),
421423
)
422424

423425
# fix any derived view reference present in urn
@@ -535,7 +537,7 @@ def get_upstream_column_ref(
535537
)
536538

537539
return self.create_upstream_column_refs(
538-
upstream_urn=explore_urn, expected_columns=expected_columns
540+
upstream_urn=explore_urn, downstream_looker_columns=expected_columns
539541
)
540542

541543
def get_upstream_dataset_urn(self) -> List[Urn]:
@@ -588,7 +590,7 @@ def get_upstream_column_ref(
588590
) -> List[ColumnRef]:
589591
return self.create_upstream_column_refs(
590592
upstream_urn=self._get_upstream_dataset_urn(),
591-
expected_columns=field_context.column_name_in_sql_attribute(),
593+
downstream_looker_columns=field_context.column_name_in_sql_attribute(),
592594
)
593595

594596
def get_upstream_dataset_urn(self) -> List[Urn]:
@@ -649,7 +651,7 @@ def get_upstream_column_ref(
649651

650652
return self.create_upstream_column_refs(
651653
upstream_urn=self._get_upstream_dataset_urn()[0],
652-
expected_columns=field_context.column_name_in_sql_attribute(),
654+
downstream_looker_columns=field_context.column_name_in_sql_attribute(),
653655
)
654656

655657
def get_upstream_dataset_urn(self) -> List[Urn]:

0 commit comments

Comments
 (0)