-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Formated and refactored * Added dagster features
- Loading branch information
Showing
5 changed files
with
133 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from dagster import asset_check, AssetCheckResult | ||
from cuallee import Check | ||
import pandas as pd | ||
|
||
|
||
def make_dagster_checks(check: Check, asset: str, data: pd.DataFrame): | ||
rules = check.rules | ||
results = check.validate(data) | ||
checks = [] | ||
for item in results.itertuples(): | ||
|
||
@asset_check(name=f"{item.rule}", asset=asset) | ||
def _check(): | ||
return AssetCheckResult( | ||
passed=(item.status == "PASS"), | ||
metadata={ | ||
"level" : item.level, | ||
"rows": int(item.rows), | ||
"column": item.column, | ||
"value": str(item.value), | ||
"violations": int(item.violations), | ||
"pass_rate": item.pass_rate | ||
}, | ||
) | ||
|
||
checks.append(_check) | ||
return checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "cuallee" | ||
version = "0.6.0" | ||
version = "0.6.1" | ||
authors = [ | ||
{ name="Herminio Vazquez", email="[email protected]"}, | ||
{ name="Virginie Grosboillot", email="[email protected]" } | ||
|
@@ -27,6 +27,10 @@ dependencies = [ | |
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"black==23.9.1", | ||
"ruff==0.0.290" | ||
] | ||
pyspark = [ | ||
"pyspark>=3.4.0" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[metadata] | ||
name = cuallee | ||
version = 0.6.0 | ||
version = 0.6.1 | ||
[options] | ||
packages = find: |