Skip to content

Commit 6177b95

Browse files
committed
fix(ingest/powerbi): Lint fix
1 parent 2df95ac commit 6177b95

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

metadata-ingestion/src/datahub/ingestion/source/powerbi/m_query/pattern_handler.py

+18-17
Original file line numberDiff line numberDiff line change
@@ -271,26 +271,27 @@ def parse_custom_sql(
271271
def create_table_column_lineage(self, urn: str) -> List[ColumnLineageInfo]:
272272
column_lineage = []
273273

274-
for column in self.table.columns:
275-
downstream = DownstreamColumnRef(
276-
table=self.table.name,
277-
column=column.name,
278-
column_type=SchemaFieldDataTypeClass(type=column.datahubDataType),
279-
native_column_type=column.dataType or "UNKNOWN",
280-
)
281-
282-
upstreams = [
283-
ColumnRef(
284-
table=urn,
285-
column=column.name.lower(),
274+
if self.table.columns is not None:
275+
for column in self.table.columns:
276+
downstream = DownstreamColumnRef(
277+
table=self.table.name,
278+
column=column.name,
279+
column_type=SchemaFieldDataTypeClass(type=column.datahubDataType),
280+
native_column_type=column.dataType or "UNKNOWN",
286281
)
287-
]
288282

289-
column_lineage_info = ColumnLineageInfo(
290-
downstream=downstream, upstreams=upstreams
291-
)
283+
upstreams = [
284+
ColumnRef(
285+
table=urn,
286+
column=column.name.lower(),
287+
)
288+
]
289+
290+
column_lineage_info = ColumnLineageInfo(
291+
downstream=downstream, upstreams=upstreams
292+
)
292293

293-
column_lineage.append(column_lineage_info)
294+
column_lineage.append(column_lineage_info)
294295

295296
return column_lineage
296297

metadata-ingestion/src/datahub/ingestion/source/powerbi/powerbi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def extract_lineage(
239239
cll_lineage: List[FineGrainedLineage] = []
240240

241241
logger.debug(
242-
f"Extracting lineage for table {table.full_name} in dataset {table.dataset.name}"
242+
f"Extracting lineage for table {table.full_name} in dataset {table.dataset.name if table.dataset else None}"
243243
)
244244

245245
upstream_lineage: List[

0 commit comments

Comments
 (0)