Skip to content

AnalysisRunner groupBy throws UNRESOLVED_COLUMN error when DataFrame has a 'count' column #5

Description

@sudsali

I'm using PyDeequ with Spark 3.4 and getting this error when running hasNumberOfDistinctValues on a DataFrame that has a column named "count":

AnalysisException: [UNRESOLVEDCOLUMN.WITHSUGGESTION] A column or function parameter with name com_amazon_deequ_dq_metrics_count cannot be resolved

check = Check(spark, CheckLevel.Error, "test")                                                                                                                                   
check.hasNumberOfDistinctValues("count", lambda x: x == 3)                                                                                                                       
result = VerificationSuite(spark).onData(df).addCheck(check).run()                                                                                                               

This seems like a bug in how Deequ handles column name conflicts internally. The Histogram analyzer renames the column but then can't find it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions