flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

fix(identit/models): update_traits typing to support dicts

Open gagantrivedi opened this issue 3 months ago • 4 comments

Thanks for submitting a PR! Please check the boxes below:

  • [ ] I have added information to docs/ if required so people know about the feature!
  • [x] I have filled in the "Changes" section below?
  • [x] I have filled in the "How did you test this code" section below?
  • [x] I have used a Conventional Commit title for this Pull Request

Changes

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().

How did you test this code?

Please describe.

gagantrivedi avatar Dec 05 '25 06:12 gagantrivedi

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.

cursor[bot] avatar Dec 05 '25 06:12 cursor[bot]

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs Ignored Ignored Preview Dec 5, 2025 7:35am
flagsmith-frontend-preview Ignored Ignored Preview Dec 5, 2025 7:35am
flagsmith-frontend-staging Ignored Ignored Preview Dec 5, 2025 7:35am

vercel[bot] avatar Dec 05 '25 06:12 vercel[bot]

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-6371 Finished :white_check_mark: Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-6371 Finished :white_check_mark: Results :white_check_mark:
ghcr.io/flagsmith/flagsmith-api:pr-6371 Finished :white_check_mark: Results :white_check_mark:
ghcr.io/flagsmith/flagsmith:pr-6371 Finished :white_check_mark: Results :white_check_mark:
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6371 Finished :white_check_mark: Results :white_check_mark:

github-actions[bot] avatar Dec 05 '25 06:12 github-actions[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 98.02%. Comparing base (a2b62f2) to head (1bfef76). :warning: Report is 6 commits behind head on main.

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           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 05 '25 07:12 codecov[bot]