Move code to code dir
Follow yoda
This commit is contained in:
parent
e18669065e
commit
1084d78c3e
15 changed files with 12 additions and 5 deletions
24
code/tests/test_validate_unique_installs.py
Normal file
24
code/tests/test_validate_unique_installs.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import dataframely as dy
|
||||
import polars as pl
|
||||
|
||||
from tests.test_validate_date_col import DateSchema
|
||||
|
||||
|
||||
class UniquesSchema(DateSchema):
|
||||
unique: dy.Integer = dy.Integer(nullable=False)
|
||||
|
||||
@dy.rule()
|
||||
def cannot_be_zero() -> pl.Expr:
|
||||
return pl.col("unique") > 0
|
||||
|
||||
|
||||
def test_uniques_schema():
|
||||
_ = UniquesSchema.validate(
|
||||
pl.scan_csv(
|
||||
"output/unique_installs.csv",
|
||||
schema={
|
||||
"date": pl.Date,
|
||||
"unique": pl.UInt16,
|
||||
},
|
||||
).collect(engine="streaming")
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue