Open lhammer100 opened 2 days ago
Thanks. Made a fix for this to be in the next release.
Hi,
I've also tested the code from the "Best Practices Analyzer Report" and I got a similar error (not sure if it's related to this bug or not) when I tried to run create_model_bpa_semantic_model().
Could you please help with this issue?
Thank you!
AttributeError Traceback (most recent call last) Cell In[16], line 1 ----> 1 labs.create_model_bpa_semantic_model()
File ~/cluster-env/clonedenv/lib/python3.10/site-packages/sempy/_utils/_log.py:348, in mds_log.
File ~/cluster-env/clonedenv/lib/python3.10/site-packages/sempy_labs/_model_bpa_bulk.py:238, in create_model_bpa_semantic_model(dataset, lakehouse, lakehouse_workspace) 233 lakehouse = resolve_lakehouse_name( 234 lakehouse_id=lakehouse_id, workspace=lakehouse_workspace 235 ) 237 # Generate the shared expression based on the lakehouse and lakehouse workspace --> 238 expr = get_shared_expression(lakehouse=lakehouse, workspace=lakehouse_workspace) 240 # Create blank model 241 create_blank_semantic_model( 242 dataset=dataset, workspace=lakehouse_workspace, overwrite=True 243 )
File ~/cluster-env/clonedenv/lib/python3.10/site-packages/sempy_labs/directlake/_get_shared_expression.py:35, in get_shared_expression(lakehouse, workspace) 32 lakehouse_id = fabric.get_lakehouse_id() 33 lakehouse = resolve_lakehouse_name(lakehouse_id, workspace) ---> 35 dfL = list_lakehouses(workspace=workspace) 36 lakeDetail = dfL[dfL["Lakehouse Name"] == lakehouse] 38 sqlEPCS = lakeDetail["SQL Endpoint Connection String"].iloc[0]
File ~/cluster-env/clonedenv/lib/python3.10/site-packages/sempy_labs/_list_functions.py:699, in list_lakehouses(workspace) 690 prop = v.get("properties", {}) 691 sqlEPProp = prop.get("sqlEndpointProperties", {}) 693 new_data = { 694 "Lakehouse Name": v.get("displayName"), 695 "Lakehouse ID": v.get("id"), 696 "Description": v.get("description"), 697 "OneLake Tables Path": prop.get("oneLakeTablesPath"), 698 "OneLake Files Path": prop.get("oneLakeFilesPath"), --> 699 "SQL Endpoint Connection String": sqlEPProp.get("connectionString"), 700 "SQL Endpoint ID": sqlEPProp.get("id"), 701 "SQL Endpoint Provisioning Status": sqlEPProp.get("provisioningStatus"), 702 } 703 df = pd.concat([df, pd.DataFrame(new_data, index=[0])], ignore_index=True) 705 return df
AttributeError: 'NoneType' object has no attribute 'get'
I'm running pieces of the code from the "Best Practices Analyzer Report". The notebook is attached to a lake house and a relevant workspace is coded. After running labs.run_model_bpa_bulk(workspace) successfully, the call to labs.create_model_bpa_semantic_model() fails.
I have tried different variations, but they all fail with the same error message. See below.
It could be related to the call to create_blank_semantic_model(), were the json defining the blank semantic model includes setting languate and collation, but I'm not fully sure.
The following is the full error message: