Also moved code dir to src. There are reasons to do standard things in standard ways. While it is possible to get the `code/` directory to work, and recognize it as a package path, this requires wrangling the pyproject.toml file. Additionally, any import from the `code.something` path automatically shadows the python stdlib `code` module. While it may not be necessary, it still is good to not shadow standard library modules.
22 lines
544 B
Python
22 lines
544 B
Python
import dataframely as dy
|
|
import polars as pl
|
|
|
|
from tests.test_validate_date_col import DateSchema
|
|
|
|
|
|
class KernelsSchema(DateSchema):
|
|
kernel: dy.String = dy.String(nullable=False)
|
|
downloads: dy.Integer = dy.Integer(nullable=False)
|
|
|
|
|
|
def test_kernels_schema():
|
|
_ = KernelsSchema.validate(
|
|
pl.scan_csv(
|
|
"output/kernels.csv",
|
|
schema={
|
|
"date": pl.Date,
|
|
"kernel": pl.String,
|
|
"downloads": pl.UInt32,
|
|
},
|
|
).collect(engine="streaming")
|
|
)
|