Skip to content

Commit f9f66ca

Browse files
thodson-usgsclaude
andcommitted
fix(waterdata): Drop dataclass slots=True for Python 3.9 compat
``slots=True`` for ``@dataclass`` requires Python 3.10. The package declares ``requires-python = ">=3.9"`` and CI tests 3.9, so the import was failing test collection on the 3.9 matrix cell. Dropping the kwarg loses a small memory optimization on short-lived ``_Axis`` instances (not material) and restores compatibility. Also aligns one residual "sub-chunk" comment to "chunk" — the rest of the file already uses "chunk". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 95bd5f0 commit f9f66ca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

dataretrieval/waterdata/chunking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def _request_bytes(req: requests.PreparedRequest) -> int:
452452
return len(req.url) + body_len
453453

454454

455-
@dataclass(frozen=True, slots=True)
455+
@dataclass(frozen=True)
456456
class _Axis:
457457
"""
458458
A single chunkable axis of one user-level request — a list of
@@ -932,7 +932,7 @@ def _combine_chunk_frames(frames: list[pd.DataFrame]) -> pd.DataFrame:
932932
Dedup is restricted to rows whose ``id`` is non-null. ``pandas``
933933
treats NaN==NaN as a duplicate for ``drop_duplicates``, so a
934934
blanket call would collapse every id-less row into a single one —
935-
silent data loss if any sub-chunk emits features without an
935+
silent data loss if any chunk emits features without an
936936
``id`` field.
937937
"""
938938
non_empty = [f for f in frames if not f.empty]

0 commit comments

Comments
 (0)