refactor: rename DelimitedList to DelimitedCollection - #80
Conversation
The package held `DelimitedList` and `CounterPivotTable` — Pydantic mixins that transform `Metric` fields to and from their delimited-text representation, not collection types in their own right. Rename to `converters` to name them by what they do. `Metric` is the only importer; the move is behavior-preserving. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the previous `_empty_field_to_none` validator from `Metric` into a
reusable `NullSentinels` mixin that exposes a `null_sentinels: frozenset[str]`
ClassVar. Users can now configure additional string sentinels (e.g., "NA", "None")
to be treated as null on Optional fields.
Scoped to Optional fields to keep the mixin composable with `DelimitedList`'s
`list[T]` handling. `Metric` defaults to `frozenset({""})` to preserve
fgpyo-aligned behavior.
Closes #8.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address review feedback. The Optional-field key collection handled only plain string aliases, so a field reachable solely via `AliasChoices` was never sentinel-substituted. Extract a `_validation_keys` helper that also expands the string members of an `AliasChoices`; path-shaped `AliasPath` stays out of scope for flat delimited rows. Document that `serialization_alias` is output-only and therefore excluded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename the `DelimitedList` mixin to `DelimitedCollection` (and the module `_delimited_list.py` to `_delimited_collection.py`) ahead of generalizing it beyond `list`. Also reorganize the converter tests to one file per converter: the delimited-list tests move to `test_delimited_collection.py` and the Counter tests to `test_counter_pivot_table.py`. Pure rename and test reorganization; no behavior change. Relates to #76. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 1 hour. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
Summary
This PR is the first in a stack to expand
Metric's collection parsing behavior to supporttuple,set, anddictalong with the existinglistsupport, to provide parity with fgpyo.This PR is a pure rename and test reorganization.
Related Stack
Stacked PR 1/5 toward #76. Stacked on #35.