pythondatabricksdelta-lakedelta-live-tables

Module 'dlt' has no attribute 'table' - databricks and delta live tables


I am new to databricks and delta live tables. I have problem with creating delta live table in python.

enter image description here

enter image description here

enter image description here

How to create delta live table from json files in filestore?


Solution

  • It is a decorator, so I think you also need a function after. Meaning

    @dlt.table(comment="your comment")
    def get_bronze():
        df=spark.sql("""select * from myDb.MyRegisterdTable""")
        #If you wanna check logs:
        #print("bronze",df.take(5),"end")
        return df
    

    In silver function then you can read it as:

    @dlt.table
    def get_silver():
        df = dlt.read("get_bronze")
        [..do_stuff...]
        return df
    
    

    Also from your screenshots I am not sure, are you running all this as a pipeline or are you trying to run a Notebook? The latter does not work.