diff --git a/src/sempy_labs/_model_bpa.py b/src/sempy_labs/_model_bpa.py index 3fb07dcd..7ee75694 100644 --- a/src/sempy_labs/_model_bpa.py +++ b/src/sempy_labs/_model_bpa.py @@ -511,4 +511,5 @@ def translate_using_spark(rule_file): tab_html += "" # 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)) diff --git a/src/sempy_labs/_model_dependencies.py b/src/sempy_labs/_model_dependencies.py index 7eee5276..2927c078 100644 --- a/src/sempy_labs/_model_dependencies.py +++ b/src/sempy_labs/_model_dependencies.py @@ -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( [ @@ -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, @@ -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, @@ -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( [ @@ -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, @@ -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,