@@ -239,7 +239,7 @@ def create_fields(self) -> List[ViewField]:
239
239
return [] # it is for the special case
240
240
241
241
def create_upstream_column_refs (
242
- self , upstream_urn : str , expected_columns : List [str ]
242
+ self , upstream_urn : str , downstream_looker_columns : List [str ]
243
243
) -> List [ColumnRef ]:
244
244
"""
245
245
- **`upstream_urn`**: The URN of the upstream dataset.
@@ -258,12 +258,14 @@ def create_upstream_column_refs(
258
258
urn , schema_info = schema_resolver .resolve_urn (urn = upstream_urn )
259
259
260
260
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
+ )
262
264
else :
263
265
logger .info (
264
266
f"schema_info not found for dataset { urn } in GMS. Using expected_columns to form ColumnRef"
265
267
)
266
- actual_columns = [column .lower () for column in expected_columns ]
268
+ actual_columns = [column .lower () for column in downstream_looker_columns ]
267
269
268
270
upstream_column_refs : List [ColumnRef ] = []
269
271
@@ -417,7 +419,7 @@ def get_upstream_column_ref(
417
419
upstream_urn = self ._get_upstream_dataset_urn ()[
418
420
0
419
421
], # 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 (),
421
423
)
422
424
423
425
# fix any derived view reference present in urn
@@ -535,7 +537,7 @@ def get_upstream_column_ref(
535
537
)
536
538
537
539
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
539
541
)
540
542
541
543
def get_upstream_dataset_urn (self ) -> List [Urn ]:
@@ -588,7 +590,7 @@ def get_upstream_column_ref(
588
590
) -> List [ColumnRef ]:
589
591
return self .create_upstream_column_refs (
590
592
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 (),
592
594
)
593
595
594
596
def get_upstream_dataset_urn (self ) -> List [Urn ]:
@@ -649,7 +651,7 @@ def get_upstream_column_ref(
649
651
650
652
return self .create_upstream_column_refs (
651
653
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 (),
653
655
)
654
656
655
657
def get_upstream_dataset_urn (self ) -> List [Urn ]:
0 commit comments