CaCu's dummy model in its own folder

This commit is contained in:
2026-11-04 21:38:37 -06:00
parent 1f6e2df051
commit 37fb292a4f
9 changed files with 218 additions and 8 deletions
+6
View File
@@ -22,6 +22,12 @@ class CohortFileError(ValueError):
"""The file isn't a cohort build: its columns or types aren't `SCHEMA`'s."""
def cohort_lineage(path: str | Path) -> dict[str, str]:
"""The lineage in the file's metadata, without reading any rows."""
metadata = pq.read_metadata(path).metadata
return {k.decode(): v.decode() for k, v in metadata.items() if k not in (b"pandas", b"ARROW:schema")}
def read_cohort(path: str | Path) -> pd.DataFrame:
"""The build's rows, after checking the file's schema without reading them."""
schema = pq.read_schema(path)