Skip to content

Conversation

@dashed
Copy link
Member

@dashed dashed commented Jul 23, 2024

Fields in RPC models that begin with underscores are automatically excluded: https://docs.pydantic.dev/1.10/usage/models/#automatically-excluded-attributes

To avoid this, we need to mark them with PrivateAttr().

Otherwise, RpcOrganization.default_owner_id will always return None.

This is needed for https://github.com/getsentry/getsentry/pull/14709.

@dashed dashed requested review from a team July 23, 2024 18:08
@dashed dashed self-assigned this Jul 23, 2024
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 23, 2024
@codecov
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.14%. Comparing base (7f16895) to head (ce0e2d9).
Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #74748      +/-   ##
==========================================
- Coverage   78.14%   78.14%   -0.01%     
==========================================
  Files        6730     6731       +1     
  Lines      300110   300214     +104     
  Branches    51623    51642      +19     
==========================================
+ Hits       234528   234600      +72     
- Misses      59257    59286      +29     
- Partials     6325     6328       +3     
Files Coverage Δ
...entry/organizations/services/organization/model.py 89.81% <66.66%> (ø)

... and 10 files with indirect coverage changes

@dashed dashed merged commit cff5483 into master Jul 23, 2024
@dashed dashed deleted the hybrid-cloud/fix-private-field-for-org-model branch July 23, 2024 20:47
Christinarlong pushed a commit that referenced this pull request Jul 26, 2024
Fields in RPC models that begin with underscores are automatically
excluded:
https://docs.pydantic.dev/1.10/usage/models/#automatically-excluded-attributes

To avoid this, we need to mark them with
[`PrivateAttr()`](https://docs.pydantic.dev/1.10/usage/models/#private-model-attributes).

Otherwise, `RpcOrganization.default_owner_id` will always return `None`.

This is needed for getsentry/getsentry#14709.
@github-actions github-actions bot locked and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants