Skip to content

Commit

Permalink
fixed issue with model dependencies (warning)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kovalsky committed Oct 1, 2024
1 parent 91e9326 commit 6ed7b3c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/sempy_labs/_model_bpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,4 +511,5 @@ def translate_using_spark(rule_file):
tab_html += "</div>"

# Display the tabs, tab contents, and run the script
return display(HTML(styles + tab_html + content_html + script))
if not export:
return display(HTML(styles + tab_html + content_html + script))
36 changes: 18 additions & 18 deletions src/sempy_labs/_model_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_measure_dependencies(

for index, dependency in dep_filt.iterrows():
d = True
if dependency[5] == "Measure":
if dependency.iloc[5] == "Measure":
d = False
df = pd.concat(
[
Expand All @@ -85,12 +85,12 @@ def get_measure_dependencies(
"Table Name": r["Table Name"],
"Object Name": r["Object Name"],
"Object Type": r["Object Type"],
"Referenced Object": dependency[4],
"Referenced Table": dependency[3],
"Referenced Object Type": dependency[5],
"Referenced Object": dependency.iloc[4],
"Referenced Table": dependency.iloc[3],
"Referenced Object Type": dependency.iloc[5],
"Done": d,
"Full Object Name": r["Full Object Name"],
"Referenced Full Object Name": dependency[
"Referenced Full Object Name": dependency.iloc[
7
],
"Parent Node": rObj,
Expand All @@ -110,12 +110,12 @@ def get_measure_dependencies(
"Table Name": r["Table Name"],
"Object Name": r["Object Name"],
"Object Type": r["Object Type"],
"Referenced Object": dependency[4],
"Referenced Table": dependency[3],
"Referenced Object Type": dependency[5],
"Referenced Object": dependency.iloc[4],
"Referenced Table": dependency.iloc[3],
"Referenced Object Type": dependency.iloc[5],
"Done": d,
"Full Object Name": r["Full Object Name"],
"Referenced Full Object Name": dependency[
"Referenced Full Object Name": dependency.iloc[
7
],
"Parent Node": rObj,
Expand Down Expand Up @@ -203,7 +203,7 @@ def get_model_calc_dependencies(

for index, dependency in dep_filt.iterrows():
d = True
if dependency[5] in objs:
if dependency.iloc[5] in objs:
d = False
df = pd.concat(
[
Expand All @@ -214,12 +214,12 @@ def get_model_calc_dependencies(
"Table Name": r["Table Name"],
"Object Name": r["Object Name"],
"Object Type": r["Object Type"],
"Referenced Object": dependency[4],
"Referenced Table": dependency[3],
"Referenced Object Type": dependency[5],
"Referenced Object": dependency.iloc[4],
"Referenced Table": dependency.iloc[3],
"Referenced Object Type": dependency.iloc[5],
"Done": d,
"Full Object Name": r["Full Object Name"],
"Referenced Full Object Name": dependency[
"Referenced Full Object Name": dependency.iloc[
7
],
"Parent Node": rObj,
Expand All @@ -239,12 +239,12 @@ def get_model_calc_dependencies(
"Table Name": r["Table Name"],
"Object Name": r["Object Name"],
"Object Type": r["Object Type"],
"Referenced Object": dependency[5],
"Referenced Table": dependency[4],
"Referenced Object Type": dependency[6],
"Referenced Object": dependency.iloc[5],
"Referenced Table": dependency.iloc[4],
"Referenced Object Type": dependency.iloc[6],
"Done": d,
"Full Object Name": r["Full Object Name"],
"Referenced Full Object Name": dependency[
"Referenced Full Object Name": dependency.iloc[
7
],
"Parent Node": rObj,
Expand Down

0 comments on commit 6ed7b3c

Please sign in to comment.