04-03-2024 05:41 AM
Hi Everyone,
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'".
code snippet:
I have the dlt module loaded via pip install
04-03-2024 07:40 AM
Hey @DE_K , It's hard to follow without some more context, but shouldn't that be live instead of dlt - "select * from live.{0}".format(model_name)", considering you have already created the table.
04-03-2024 08:06 AM
Hi @YuliyanBogdanov , 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.
04-03-2024 11:57 PM
Thank You, @DE_K. I see your point. I believe you are using the @dlt.table instead of @dlt.create_table to begin with, since want the table to be created and not define and existing one. (https://community.databricks.com/t5/data-engineering/difference-dlt-table-and-dlt-create-table-decor...). Let me know if this helped.
04-05-2024 02:54 AM
Hi @YuliyanBogdanov , no luck with that as well. getting same error. Not sure what is it that I am missing.
I installed dlt using pip install dlt. I believe that is the way to go.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group