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

Add two overload variants to validate_arguments #2055

Merged
merged 4 commits into from
Oct 28, 2020
Merged

Add two overload variants to validate_arguments #2055

merged 4 commits into from
Oct 28, 2020

Conversation

layday
Copy link
Contributor

@layday layday commented Oct 27, 2020

Change Summary

Added two overload variants to validate_arguments for the nested decorator signature.

Related issue number

fix #2052

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • 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)

@codecov
Copy link

codecov bot commented Oct 27, 2020

Codecov Report

Merging #2055 into master will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2055   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         4094      4094           
  Branches       821       821           
=========================================
  Hits          4094      4094           
Impacted Files Coverage Δ
pydantic/decorator.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95435de...1f4d9a9. Read the comment docs.

Copy link
Collaborator

@PrettyWood PrettyWood left a comment

Choose a reason for hiding this comment

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

Other than that looks good 👍



# nested decorator should not produce an error
@validate_arguments(config={'arbitrary_types_allowed': True})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not put it in success.py instead of fail4.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1 @@
add two overload variants to `validate_arguments` for the nested decorator signature
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe something more user oriented like "improve/fix typing of validate_arguments to be compliant with mypy"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to:

fix annotation of validate_arguments when passing configuration as argument

@layday
Copy link
Contributor Author

layday commented Oct 27, 2020

Unrelatedly, I like how all I've got to do is run make locally before pushing - I like this better than the pre-commit workflow adopted by many other Python projects, but I suppose that's just personal preference.

Copy link
Collaborator

@PrettyWood PrettyWood left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

mypy "error: <nothing> not callable" when passing config to validate_arguments
3 participants