cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delta Live Tables Quality check for distinct Values

Zii
New Contributor II

Hi All,

I have been having an issue identifying how to do a uniqueness check for the quality check. Below is an example.

@dlt.expect("origin_not_dup", "origin is distinct from origin")
def harmonized_data():
    df=dlt.read("raw_data")
    for col in df.columns:
        df = df.withColumnRenamed(col, col.lower())
    df=df.select("car", "mpg", "origin")
    return df

 options that i tried.

  • @dlt.expect("origin_not_dup", "origin is distinct from origin")
  • @dlt.expect("origin_not_dup", "origin is distinct")
  • @dlt.expect("origin_not_dup", "origin is unique")

they all end up with an error.

Since Delta live table is still relatively new, i wasn't able find how to do so. Any guidance is appreciated.

Thanks in advance.

0 REPLIES 0

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now