Skip to content

feat: add DQDL support via EvaluateDataQuality (#205) - #288

Closed
AMC-hawk wants to merge 1 commit into
awslabs:masterfrom
AMC-hawk:feature/dqdl-support
Closed

feat: add DQDL support via EvaluateDataQuality (#205)#288
AMC-hawk wants to merge 1 commit into
awslabs:masterfrom
AMC-hawk:feature/dqdl-support

Conversation

@AMC-hawk

@AMC-hawk AMC-hawk commented Sep 12, 2026

Copy link
Copy Markdown

Issue #, if available: Closes #205

Description of changes:

Deequ already supports data freshness as a DQDL rule (awslabs/deequ#661, in every release since 2.0.14, including the 2.0.21 jar PyDeequ pins). PyDeequ doesn't expose DQDL, so Python users can't use it. This PR adds a thin wrapper around com.amazon.deequ.dqdl.EvaluateDataQuality.

from pydeequ.dqdl import EvaluateDataQuality

ruleset = 'Rules=[IsComplete "id", DataFreshness "updated_at" <= 24 hours]'

EvaluateDataQuality.process(spark, df, ruleset)      # one row per rule
EvaluateDataQuality.processRows(spark, df, ruleset)  # originalData / ruleOutcomes / rowLevelOutcomes

Changes

  • pydeequ/dqdl.py: EvaluateDataQuality.process and processRows, matching the Scala API. Supports additionalDataSources={"alias": df} for rules like RowCountMatch, pandas=True output, and pandas input (same as VerificationSuite.onData).
  • tests/test_dqdl.py: output schema, passing and failing DataFreshness rules (including the compliance metric), days/minutes units, additionalDataSources, pandas output, row-level outcomes, and input validation.
  • README.md and docs/source/pydeequ.rst: usage section and API docs.

No changes to existing APIs or the Deequ dependency.

Notes

  • DataFreshness doesn't have row-level support in Deequ, so processRows lists it under DataQualityRulesSkip. The README says this.
  • Spark 3.5 logs ANTLR version mismatch warnings (4.7 vs 4.9.3) when the DQDL parser loads. Parsing works; the warnings come from the upstream dqdl dependency.

Testing

pytest tests/test_dqdl.py tests/test_verification.py: 15 passed locally (Spark 3.5.9, Python 3.11, Java 17, Deequ 2.0.21-spark-3.5). black and flake8 pass on the new files.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Wrap com.amazon.deequ.dqdl.EvaluateDataQuality so Python users can
evaluate DQDL rulesets, including DataFreshness for checking how recent
data is.

Adds pydeequ.dqdl.EvaluateDataQuality with process() and processRows(),
supporting additionalDataSources and pandas output, plus tests and docs.
@AMC-hawk
AMC-hawk force-pushed the feature/dqdl-support branch from 7ec9000 to 1c85686 Compare September 12, 2026 21:02

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.


Generated by AI (model: us.anthropic.claude-opus-4-8, prompt: 295226dd) — may not be fully accurate. Reply if this doesn't help.
Reviewed by Shadow · github.com/sudsali/shadow

@AMC-hawk

Copy link
Copy Markdown
Author

Superseded by #289.

@AMC-hawk AMC-hawk closed this Sep 12, 2026
@AMC-hawk
AMC-hawk deleted the feature/dqdl-support branch September 12, 2026 21:05

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.


Generated by AI (model: us.anthropic.claude-opus-4-8, prompt: 295226dd) — may not be fully accurate. Reply if this doesn't help.
Reviewed by Shadow · github.com/sudsali/shadow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data freshness metric

1 participant