<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Retrieve column descriptions from semantic models in Data Science</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4302820#M560</link>
    <description>&lt;P&gt;This works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import sempy.fabric as fabric

display(fabric.list_columns("DatasetName"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, I don't actually have column descriptions in my test dataset... But if I had, I think they would show here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 20:09:26 GMT</pubDate>
    <dc:creator>frithjof_v</dc:creator>
    <dc:date>2024-11-26T20:09:26Z</dc:date>
    <item>
      <title>Retrieve column descriptions from semantic models</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4300370#M557</link>
      <description>&lt;P&gt;I'm trying to write a kind of "data glossary" report, where I went to detail all of the column and column descriptions from various reports. I'm trying to use the SemPy library to do this, but can't seem to figure out how to get the column descriptions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've looked at several articles, e.g., this one:&amp;nbsp;&lt;A href="https://www.linkedin.com/pulse/document-your-fabric-datasets-using-semantic-link-api-bouaddi-mba-tadse/" target="_blank"&gt;(25) Document your fabric datasets using the semantic link and ChatGPT API | LinkedIn&lt;/A&gt;&amp;nbsp;and can successfully get a list of all tables and their columns, but I can't get their column descriptions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# import the module&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; sempy.fabric &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; fabric&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# set the semantic model&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sm = &lt;/SPAN&gt;&lt;SPAN&gt;"TableName"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;# add table info to dataframe&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df = spark.createDataFrame(fabric.list_tables(sm, &lt;/SPAN&gt;&lt;SPAN&gt;include_columns&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;include_partitions&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;extended&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;workspace&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"WorkspaceName"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;display(df)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I believe using the FabricDataFrame Class (&lt;A href="https://learn.microsoft.com/en-us/python/api/semantic-link-sempy/sempy.fabric.fabricdataframe?view=semantic-link-python" target="_blank"&gt;sempy.fabric.FabricDataFrame class | Microsoft Learn&lt;/A&gt;) might be the way forward, but can't figure out how to use it.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The plan going forward is to then iterate through several workspaces and datasets, and store all column descriptions in one place, but right now, I can't access the column descriptions&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Nov 2024 17:32:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4300370#M557</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-25T17:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve column descriptions from semantic models</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4300995#M558</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;I'd like to suggest you try to use Semantic functions to list all of the workspace items: (it will include the id, name, description, type and workspace id)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import sempy.fabric as fabric

# Get the items of this workspace
workspace_items=fabric.list_items()

# Filter by type to get DataPipeline list
#itemList= workspace_items[workspace_items.Type == "DataPipeline"]

display(workspace_items)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-science/semantic-link-semantic-functions" target="_blank" rel="noopener"&gt;Semantic functions - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 02:57:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4300995#M558</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-26T02:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve column descriptions from semantic models</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4301808#M559</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="90264" data-lia-user-login="OR" class="lia-mention lia-mention-user"&gt;OR&lt;/a&gt; the response, but that hasn't answered my question. I already have a list of workspaces and semantic models. I can also get the columns that are in the semantic models, but what I'm struggling tog et is the column d3escriptions. Do you know how I can get these?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 09:21:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4301808#M559</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-26T09:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve column descriptions from semantic models</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4302820#M560</link>
      <description>&lt;P&gt;This works for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import sempy.fabric as fabric

display(fabric.list_columns("DatasetName"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, I don't actually have column descriptions in my test dataset... But if I had, I think they would show here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 20:09:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Retrieve-column-descriptions-from-semantic-models/m-p/4302820#M560</guid>
      <dc:creator>frithjof_v</dc:creator>
      <dc:date>2024-11-26T20:09:26Z</dc:date>
    </item>
  </channel>
</rss>

