Skip to content

Commit e3050aa

Browse files
authored
ap66-fix namespace and pl data loading (#46)
* namespace needs to be higher level if dataops is installed side-by-side * ran into issue when each json/csv has different number of columns * version bump * adding pre-commit to make sure ns package doesn't break
1 parent e314bee commit e3050aa

5 files changed

Lines changed: 18 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ repos:
6464
stages: [pre-commit]
6565
language: system
6666
entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
67+
- id: remove-init-file-breaking-ns-packaging
68+
name: Remove __init__.py files from ./cfa/
69+
files: ^cfa/.*__init__\.py$
70+
stages: [pre-commit]
71+
language: system
72+
entry: bash -c 'find ./cfa -maxdepth 1 -name "__init__.py" -delete'

cfa/dataops/catalog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def get_dataframe(
423423
else:
424424
df = pl.concat(
425425
[pl.read_csv(blob) for blob in blob_files],
426-
how="vertical_relaxed",
426+
how="diagonal",
427427
)
428428
if pl_lazy:
429429
df = df.lazy()
@@ -461,7 +461,7 @@ def get_dataframe(
461461
else:
462462
df = pl.concat(
463463
[pl.read_parquet(pq_file) for pq_file in blob_files],
464-
how="vertical_relaxed",
464+
how="diagonal",
465465
)
466466
if pl_lazy:
467467
df = df.lazy()

cfa/dataops/create_catalog/repo_templates/pyproject.toml.mako

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ dependencies = [
2323
]
2424
2525
[tool.setuptools.packages.find]
26-
include = ["${catalog_namespace}*"]
26+
namespaces = true
27+
include = ["cfa*"]
2728
2829
[project.optional-dependencies]
2930
dev = [

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ The versioning pattern is `YYYY.MM.DD.micro(a/b/{none if release})
88

99
---
1010

11+
## [2025.12.08.0a]
12+
13+
### Fixed
14+
15+
- Polars dataframe loading+concat from csv/json files that contain varying number of columns
16+
- Namespace package configuration for created catalogs
17+
1118
## [2025.11.18.0a]
1219

1320
### Updated

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cfa.dataops"
3-
version = "2025.11.18.0a"
3+
version = "2025.12.08.0a"
44
description = "Data cataloging, ETL, modeling, verification, and validation for CFA"
55
authors = [
66
{ name = "Phil Rogers", email = "ap66@cdc.gov" },

0 commit comments

Comments
 (0)