24 lines
622 B
Python
24 lines
622 B
Python
import dataframely as dy
|
|
import polars as pl
|
|
|
|
from tests.test_validate_date_col import DateSchema
|
|
|
|
|
|
class FilesSchema(DateSchema):
|
|
filename: dy.String = dy.String(nullable=False)
|
|
mtime: dy.Float = dy.Float(nullable=False)
|
|
filesize: dy.Integer = dy.Integer(nullable=False)
|
|
|
|
|
|
def test_files_schema():
|
|
_ = FilesSchema.validate(
|
|
pl.scan_csv(
|
|
"output/files.csv",
|
|
schema={
|
|
"date": pl.Date,
|
|
"filename": pl.String,
|
|
"mtime": pl.Float32,
|
|
"filesize": pl.UInt32,
|
|
},
|
|
).collect(engine="streaming")
|
|
)
|