Skip to content
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

Catch Exceptions in smart_deepcopy #4187

Merged

Conversation

coneybeare
Copy link
Contributor

@coneybeare coneybeare commented Jun 27, 2022

Change Summary

This PR comes from an issue where a sqlalchemy column definition was raising when not obj was called in smart_deepcopy. Whether or not the raise is warranted is a question for sqlalchemy, but catching the error here and falling back to deepcopy on seems to be a decent approach as a raise of this nature prevents application import and load.

Related issue number

Closes #4184

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100% (coverage is 99.08, but only because of unrelated files missed coverage)
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@coneybeare
Copy link
Contributor Author

please review @samuelcolvin

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

Looking good, just one thing to change.

pydantic/utils.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
pydantic/utils.py Show resolved Hide resolved
@samuelcolvin
Copy link
Member

please update.

@samuelcolvin
Copy link
Member

LGTM, @coneybeare is this complete?

@coneybeare
Copy link
Contributor Author

@samuelcolvin I believe it is, yes

@samuelcolvin samuelcolvin enabled auto-merge (squash) August 11, 2022 12:35
@samuelcolvin
Copy link
Member

great, thanks so much.

In future, it's safest to use the magic comment "please review" to assign the PR to me and make sure I know the PR needs my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

smart_deepcopy causes sqlalchemy boolean value error on import
4 participants