Skip to content

refactor: rename DelimitedList to DelimitedCollection - #80

Open
msto wants to merge 4 commits into
mainfrom
msto/rename-delimited-collection
Open

refactor: rename DelimitedList to DelimitedCollection#80
msto wants to merge 4 commits into
mainfrom
msto/rename-delimited-collection

Conversation

@msto

@msto msto commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR is the first in a stack to expand Metric's collection parsing behavior to support tuple, set, and dict along with the existing list support, 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.

msto and others added 4 commits June 16, 2026 11:43
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>
@msto msto self-assigned this Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@msto, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f03acef-eb24-49f7-a328-e224c6bfba53

📥 Commits

Reviewing files that changed from the base of the PR and between e9b0aba and 8944939.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • fgmetric/converters/__init__.py
  • fgmetric/converters/_delimited_collection.py
  • fgmetric/converters/_null_sentinels.py
  • fgmetric/metric.py
  • tests/test_counter_pivot_table.py
  • tests/test_delimited_collection.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@msto

msto commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Base automatically changed from msto/null-sentinels-mixin to main June 24, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant