Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove guarding check on computed field with field_serializer#10390

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

nix010
Copy link
Contributor

@nix010nix010 commentedSep 12, 2024
edited by pydantic-hookybot
Loading

Change Summary

Remove guarding check on computed field with field_serializer

Related issue number

#9683

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review,please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer:@sydney-runkle

@github-actionsgithub-actionsbot added the relnotes-fixUsed for bugfixes. labelSep 12, 2024
@nix010
Copy link
ContributorAuthor

please review

pydantic-hooky[bot] reacted with thumbs up emoji

@codspeed-hqCodSpeed HQ
Copy link

codspeed-hqbot commentedSep 12, 2024
edited
Loading

CodSpeed Performance Report

Merging#10390 willnot alter performance

Comparingnix010:9683-computed-field-and-field-serializer (4be672b) withmain (a6dc872)

Summary

✅ 49 untouched benchmarks

@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedSep 12, 2024
edited
Loading

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic/_internal
  _decorators.py
  _generate_schema.py
Project Total 

This report was generated bypython-coverage-comment-action

def two_x(self) -> int:
return self.x * 2
@field_serializer('two_x')
def ser_two_x_bad_signature(self, v, _info):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should probably rename this - doesn't have a bad signature now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can probably delete this test honestly - not sure of the value here anymore, especially given the other test added above.

nix010 reacted with thumbs up emoji
Copy link
Contributor

@sydney-runklesydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

A few change requests, thanks!

def two_x(self) -> int:
return self.x * 2
@field_serializer('two_x')
def ser_two_x_bad_signature(self, v, _info):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can probably delete this test honestly - not sure of the value here anymore, especially given the other test added above.

nix010 reacted with thumbs up emoji
@pydantic-hookypydantic-hookybot added awaiting author revisionawaiting changes from the PR author and removed ready for review labelsSep 12, 2024
@sydney-runklesydney-runkle added relnotes-feature and removed awaiting author revisionawaiting changes from the PR author relnotes-fixUsed for bugfixes. labelsSep 12, 2024
@sydney-runkle
Copy link
Contributor

LGTM overall - happy to merge after we fix up the tests a bit.

Confirming with the team that there was no reason not to support this, before we merge as well.

@sydney-runkle
Copy link
Contributor

sydney-runkle commentedSep 12, 2024
edited
Loading

See#6965 where this was added - there's some other relevant code that we should update. We can remove thecomputed_field: bool from the_apply_field_serializers function, as well :).

@sydney-runklesydney-runkle added the awaiting author revisionawaiting changes from the PR author labelSep 12, 2024
@nix010
Copy link
ContributorAuthor

@sydney-runkle removed. please review again.

See#6965 where this was added - there's some other relevant code that we should update. We can remove thecomputed_field: bool from the_apply_field_serializers function, as well :).

pydantic-hooky[bot] reacted with thumbs up emoji

@pydantic-hookypydantic-hookybot added ready for review and removed awaiting author revisionawaiting changes from the PR author labelsSep 13, 2024
Copy link
Contributor

@sydney-runklesydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Great work! Thanks so much@nix010!

@sydney-runklesydney-runkle merged commit656481f intopydantic:mainSep 13, 2024
60 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sydney-runklesydney-runklesydney-runkle approved these changes

Assignees

@sydney-runklesydney-runkle

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@nix010@sydney-runkle

[8]ページ先頭

©2009-2025 Movatter.jp