<?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: @dlt.table throws error AttributeError: module 'dlt' has no attribute 'table' in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65430#M32806</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/103181"&gt;@DE_K&lt;/a&gt;&amp;nbsp;, It's hard to follow without some more context, but shouldn't that be live instead of dlt - "&lt;SPAN&gt;select&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;live&lt;/STRONG&gt;.{&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.format(model_name)", considering you have already created the table.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 14:40:22 GMT</pubDate>
    <dc:creator>YuliyanBogdanov</dc:creator>
    <dc:date>2024-04-03T14:40:22Z</dc:date>
    <item>
      <title>@dlt.table throws error AttributeError: module 'dlt' has no attribute 'table'</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65401#M32798</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;I am new to DLT and am trying to run below code to create table dynamically. But I get error "AttributeError: module 'dlt' has no attribute 'table'".&amp;nbsp;&lt;/P&gt;&lt;P&gt;code snippet:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt; &lt;SPAN&gt;generate_tables&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;model_name&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; spark&lt;/SPAN&gt;&lt;SPAN&gt;.sql&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;select&lt;/SPAN&gt; &lt;SPAN&gt;*&lt;/SPAN&gt; &lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;dlt.{&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.format(model_name))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; @&lt;/SPAN&gt;&lt;SPAN&gt;dlt&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;append_flow&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;target&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; model_name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&g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lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;comment&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"RAW: &lt;/SPAN&gt;&lt;SPAN&gt;{}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;(model_name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ) &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;def&lt;/SPAN&gt; &lt;SPAN&gt;create_table&lt;/SPAN&gt;&lt;SPAN&gt;(): &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; tableSchema&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;createSchema&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Meta_Data.csv'&lt;/SPAN&gt;&lt;SPAN&gt;,model_name)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;(spark.read.&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"csv"&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;option&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/S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;&lt;SPAN&gt;()))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; dlt&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;generate_tables&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'dlt_Raw'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;when I run the generate_tables function with parameter, I get the above error.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DE_K_0-1712148007690.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6893i056B2B7E64D6CECC/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="DE_K_0-1712148007690.png" alt="DE_K_0-1712148007690.png" /&gt;&lt;/span&gt;&lt;P&gt;I have the dlt module loaded via pip install&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Apr 2024 12:41:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65401#M32798</guid>
      <dc:creator>DE_K</dc:creator>
      <dc:date>2024-04-03T12:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: @dlt.table throws error AttributeError: module 'dlt' has no attribute 'table'</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65430#M32806</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/103181"&gt;@DE_K&lt;/a&gt;&amp;nbsp;, It's hard to follow without some more context, but shouldn't that be live instead of dlt - "&lt;SPAN&gt;select&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;live&lt;/STRONG&gt;.{&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.format(model_name)", considering you have already created the table.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:40:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65430#M32806</guid>
      <dc:creator>YuliyanBogdanov</dc:creator>
      <dc:date>2024-04-03T14:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: @dlt.table throws error AttributeError: module 'dlt' has no attribute 'table'</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65433#M32807</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102853"&gt;@YuliyanBogdanov&lt;/a&gt;&amp;nbsp;, That piece of code is under @dlt.append_flow which I believe would append the data, the exception section would first create the table. The code follows same path and goes to exception section but throws error at @dlt.table . So if you have any idea as to why its happening, please let me know.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:06:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65433#M32807</guid>
      <dc:creator>DE_K</dc:creator>
      <dc:date>2024-04-03T15:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: @dlt.table throws error AttributeError: module 'dlt' has no attribute 'table'</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65480#M32822</link>
      <description>&lt;P&gt;Thank You,&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/103181"&gt;@DE_K&lt;/a&gt;.&amp;nbsp;I see your point. I believe you are using the&amp;nbsp;@dlt.table instead of&amp;nbsp;@dlt.create_table to begin with, since want the table to be created and not define and existing one. (&lt;A href="https://community.databricks.com/t5/data-engineering/difference-dlt-table-and-dlt-create-table-decorator/td-p/42953" target="_blank"&gt;https://community.databricks.com/t5/data-engineering/difference-dlt-table-and-dlt-create-table-decorator/td-p/42953&lt;/A&gt;). Let me know if this helped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 06:57:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65480#M32822</guid>
      <dc:creator>YuliyanBogdanov</dc:creator>
      <dc:date>2024-04-04T06:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: @dlt.table throws error AttributeError: module 'dlt' has no attribute 'table'</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65570#M32845</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102853"&gt;@YuliyanBogdanov&lt;/a&gt;&amp;nbsp;, no luck with that as well. getting same error. Not sure what is it that I am missing.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DE_K_0-1712310778914.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6928i5DBF764401811E92/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="DE_K_0-1712310778914.png" alt="DE_K_0-1712310778914.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I installed dlt using pip install dlt. I believe that is the way to go.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 09:54:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-table-throws-error-attributeerror-module-dlt-has-no/m-p/65570#M32845</guid>
      <dc:creator>DE_K</dc:creator>
      <dc:date>2024-04-05T09:54:16Z</dc:date>
    </item>
  </channel>
</rss>

