Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
smeetsh
Continued Contributor
Continued Contributor

Forcing the refresh of the sql endpoint of a lakehouse using

Hi All,

 

I came across this site:
Code Examples · microsoft/semantic-link-labs Wiki · GitHub
I am trying to implement the semanticlink, but it doesnt seem to work. My notebook is as follows:

----------

#%pip install semantic-link-labs 
import sempy_labs as labs

item = 'xxx' # Enter the name or ID of the Fabric item
type = 'Lakehouse' # Enter the item type
workspace = 'yyy' # Enter the name or ID of the workspace

# Example 1: Refresh the metadata of all tables
tables = None
x = labs.refresh_sql_endpoint_metadata(item=item, type=type, workspace=workspace, tables=tables)
display(x)
--------
When i run it I get error: TypeError: got an unexpected keyword argument 'tables'
 
The language I have chosen in pyspark(python).
What am I missing here?
Cheers
Hans
Cheers

Hans

(If my solution was usefull, please give it a kudo, and mark it as a solution)
1 ACCEPTED SOLUTION

Kowalsky confirmed on the issue's thread that the example is wrong since tables parameters is not exposed by the api.
as of now you can't choose which table to refresh, it's all or nothing.

 


--
Riccardo Perico
BI Architect @ Lucient Italia | Microsoft MVP

Blog | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
smeetsh
Continued Contributor
Continued Contributor

I have created an issue on the git, lets see what comes back

Cheers

Hans

(If my solution was usefull, please give it a kudo, and mark it as a solution)

the bug is in this file I think: _sql_endpoints.py 

 

the parameter "tables" doesn't exist for that function.

 

def refresh_sql_endpoint_metadata(
    item: str | UUID,
    type: Literal["Lakehouse", "MirroredDatabase"],
    workspace: Optional[str | UUID] = None,
    timeout_unit: Literal["Seconds", "Minutes", "Hours", "Days"] = "Minutes",
    timeout_value: int = 15,
) -> pd.DataFrame:
    """
    Refreshes the metadata of a SQL endpoint.

    This is a wrapper function for the following API: `Items - Refresh Sql Endpoint Metadata <https://learn.microsoft.com/rest/api/fabric/sqlendpoint/items/refresh-sql-endpoint-metadata>`_.

    Service Principal Authentication is supported (see `here <https://github.com/microsoft/semantic-link-labs/blob/main/notebooks/Service%20Principal.ipynb>`_ for examples).

    Parameters
    ----------
    item : str | uuid.UUID
        The name or ID of the item (Lakehouse or MirroredDatabase).
    type : Literal['Lakehouse', 'MirroredDatabase']
        The type of the item. Must be 'Lakehouse' or 'MirroredDatabase'.
    workspace : str | uuid.UUID, default=None
        The Fabric workspace name or ID.
        Defaults to None which resolves to the workspace of the attached lakehouse
        or if no lakehouse attached, resolves to the workspace of the notebook.
    timeout_unit : Literal['Seconds', 'Minutes', 'Hours', 'Days'], default='Minutes'
        The unit of time for the request duration before timing out. Additional duration types may be added over time.
    timeout_value : int, default=15
        The number of time units in the request duration.

 

anyway as clearly stated in the function definition this is just a wrapper of the api that refresh metadata for all tables it seems there's no way to do it just for one table (as of now).

 


--
Riccardo Perico
BI Architect @ Lucient Italia | Microsoft MVP

Blog | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Kowalsky confirmed on the issue's thread that the example is wrong since tables parameters is not exposed by the api.
as of now you can't choose which table to refresh, it's all or nothing.

 


--
Riccardo Perico
BI Architect @ Lucient Italia | Microsoft MVP

Blog | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tayloramy
Super User
Super User

Hi @smeetsh

 

I have not used semantic link labs to do this, so I'm not sure what error you may be running into there. Seeing as you're using the sample code, maybe this is a bug that you should report? 

What I have done is refresh directly with the API. IT is described here: 

Refresh SQL analytics endpoint Metadata REST API (Generally Available) | Microsoft Fabric Blog | Mic... 

and further described here: Items - Refresh Sql Endpoint Metadata - REST API (SQLEndpoint) | Microsoft Learn

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.





If you found this helpful, consider giving some Kudos.
If I answered your question or solved your problem, mark this post as the solution!

Join the Fabric Discord!

Proud to be a Super User!





smeetsh
Continued Contributor
Continued Contributor

I am aware of that article, but it requires some work in the background (clientID's secrets, api keys etc), Also it seems to refresh the whole lakehouse and we have a lot of pipelines that are scheduled at various times, which means i will be calling that notebook dozens of times per day, which seems a waste of CU's

Cheers

Hans

(If my solution was usefull, please give it a kudo, and mark it as a solution)

Helpful resources

Announcements
June Fabric Update Carousel

Fabric Monthly Update - June 2026

Check out the June 2026 Fabric update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.