Skip to content
Merged

1014 #1072

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions src/sempy_labs/directlake/_update_directlake_partition_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ def update_direct_lake_partition_entity(
f"{icons.red_dot} The '{dataset_name}' semantic model within the '{workspace_name}' workspace is not in Direct Lake mode."
)

for tName in table_name:
i = table_name.index(tName)
for i, tName in enumerate(table_name):
eName = entity_name[i]
part_name = next(
p.Name
Expand All @@ -86,15 +85,8 @@ def update_direct_lake_partition_entity(

# Update source lineage tag
if schema:
# Only set schema for DL over SQL (not DL over OneLake)
expression_source_name = (
tom.model.Tables[tName]
.Partitions[part_name]
.Source.ExpressionSource.Name
)
expr = tom.model.Expressions[expression_source_name].Expression
if "Sql.Database" in expr:
tom.model.Tables[tName].Partitions[
# Updated to all DL patterns (DLOL, DLSQL)
tom.model.Tables[tName].Partitions[
part_name
].Source.SchemaName = schema
tom.model.Tables[tName].SourceLineageTag = f"[{schema}].[{eName}]"
Expand Down
Loading