-
Notifications
You must be signed in to change notification settings - Fork 465
fix(identit/models): update_traits typing to support dicts #6371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(identit/models): update_traits typing to support dicts #6371
Conversation
The trait_value field in SDKTraitData now correctly accepts both: - Structured SDKTraitValueData (from serializer validation via TraitValueField) - Raw primitive values (str, int, bool, float) when called directly - None (to delete traits) This aligns the type definition with the actual runtime behavior of update_traits() and generate_traits() methods which handle both cases via Trait.generate_trait_value_data().
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 10. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Docker builds report
|
…ypes The value field can be str, int, bool, or float based on the trait's actual value type, not just str.
- Remove unused type: ignore comments in launch_darkly/services.py now that SDKTraitData accepts raw trait values - Update get_transient_identifier to handle both SDKTraitValueData and raw primitive values with proper type narrowing
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6371 +/- ##
=======================================
Coverage 98.02% 98.02%
=======================================
Files 1282 1282
Lines 45498 45500 +2
=======================================
+ Hits 44600 44602 +2
Misses 898 898 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tests cover: - Structured SDKTraitValueData format (from serializer validation) - Raw primitive values (str, int, bool, float) - None values being skipped - Empty list returning UUID - Same value in structured vs raw format producing same hash
…nt_identifier The function only receives SDKTraitValueData from serializer paths, so a type: ignore comment is sufficient to handle the broadened TraitValue type.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature!Changes
The trait_value field in SDKTraitData now correctly accepts both:
This aligns the type definition with the actual runtime behavior of update_traits() and generate_traits() methods which handle both cases via Trait.generate_trait_value_data().
How did you test this code?
Please describe.