chore: replace pydantic models with stdlib dataclasses - #195
Open
tylerjroach wants to merge 1 commit into
Open
Conversation
Removes the pydantic dependency (issue #190). Feature-flag types in mixpanel/flags/types.py are now stdlib dataclasses with from_dict parsers that keep the previous lenient extra-key behavior. Also drops pydantic from uv.lock, updates repo docs, and fixes README examples that passed a non-existent token= kwarg to the config classes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The new parsers preserve required nested feature-flag construction, ignore forward-compatible extra fields, and the provider call sites consistently use the replacement dataclass APIs.
|
| Filename | Overview |
|---|---|
| mixpanel/flags/types.py | Replaces Pydantic DTOs with dataclasses and explicit parsers while preserving nested model construction and fallback-copy behavior. |
| mixpanel/flags/local_feature_flags.py | Switches local definitions to dataclass parsing and uses deepcopy when applying rollout-specific variant splits. |
| mixpanel/flags/remote_feature_flags.py | Switches remote flag responses from Pydantic validation to the new parser. |
| pyproject.toml | Removes the Pydantic runtime dependency and updates related lint guidance. |
| uv.lock | Removes Pydantic and its transitive packages without changing the investigated advisory-bearing dependencies. |
Reviews (1): Last reviewed commit: "chore: replace pydantic models with stdl..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #195 +/- ##
==========================================
+ Coverage 96.33% 96.39% +0.06%
==========================================
Files 15 15
Lines 2838 2888 +50
Branches 176 176
==========================================
+ Hits 2734 2784 +50
Misses 67 67
Partials 37 37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
efahk
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
from_dictparsersuv.lockCloses #190.
Testing
ruff format --check .ruff check .pytest --cov --cov-branch --cov-report=term-missing(387 passed)pytest --cov --cov-branch --cov-report=term-missing openfeature-provider/tests/(52 passed)uv lock --check