microsoft / semantic-link-labs

Early access to new features for Microsoft Fabric's Semantic Link.
MIT License
177 stars 37 forks source link

Extended information about Lakekehouse - Not admin of Fabric capacity #292

Open MASFelixPBI opened 2 days ago

MASFelixPBI commented 2 days ago

Running Semantic link labs to get extended information for lakehouse tables I get an error that The 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' Id is not a valid capacity Id.

I assume that this is because I'm not admin on the specific capacity since on the workspace I see the message below

Image

Please see the error codes below:

Error codes:

ValueError Traceback (most recent call last) Cell In[19], line 4 1 lh = 'TBUS_LH_Enterprise_PRD' 2 ws = 'TB US Restaurant Insights' ----> 4 labs.lakehouse.get_lakehouse_tables(lakehouse= None, workspace=None, extended=True)

File /nfs4/pyenv-cd640a2e-c54f-41bc-a55e-4752aaec1075/lib/python3.10/site-packages/sempy/_utils/_log.py:348, in mds_log..get_wrapper..log_decorator_wrapper(*args, *kwargs) 345 start_time = time.perf_counter() 347 try: --> 348 result = func(args, **kwargs) 350 # The invocation for get_message_dict moves after the function 351 # so it can access the state after the method call 352 message.update(extractor.get_completion_message_dict(result, arg_dict))

File /nfs4/pyenv-cd640a2e-c54f-41bc-a55e-4752aaec1075/lib/python3.10/site-packages/sempy_labs/lakehouse/_get_lakehouse_tables.py:120, in get_lakehouse_tables(lakehouse, workspace, extended, count_rows, export) 117 df = pd.concat(dfs, ignore_index=True) 119 if extended: --> 120 sku_value = get_sku_size(workspace) 121 guardrail = get_directlake_guardrails_for_sku(sku_value) 122 spark = SparkSession.builder.getOrCreate()

File /nfs4/pyenv-cd640a2e-c54f-41bc-a55e-4752aaec1075/lib/python3.10/site-packages/sempy_labs/directlake/_guardrails.py:60, in get_sku_size(workspace) 57 dfC_filt = dfC[dfC["Id"] == capacity_id] 59 if len(dfC_filt) == 0: ---> 60 raise ValueError( 61 f"{icons.red_dot} The '{capacity_id}' Id is not a valid capacity Id." 62 ) 64 return dfC_filt["Sku"].iloc[0]

ValueError: 🔴 The 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' Id is not a valid capacity Id.

m-kovalsky commented 2 days ago

I don’t think you have to be an admin of the capacity. I think you just need access to the capacity.

Do you see it in this?

import sempy.fabric as fabric fabric.list_capacities()

MASFelixPBI commented 2 days ago

With this code I can only see my trial capacity and PPU capacity.

m-kovalsky commented 2 days ago

So you don’t have proper access to see the capacity details).

MASFelixPBI commented 2 days ago

Maybe not checking everything correctly but how can I get the lakehouse information about table size row count withtout the extended capabilities?

m-kovalsky commented 2 days ago

Let me see if I can modify the function to still show extended details even if you have limited capacity access.

MASFelixPBI commented 2 days ago

Thank you, that would be a nice addition, even if we can't compare with the current capacity, if we are able to get the information about the tables would be a good piece of data.

m-kovalsky commented 2 days ago

Yeah, so the plan is to show the capacity stats if possible, if not just show None for those columns and populate the rest of the extended stats.