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

change secret types example #890

Merged
merged 5 commits into from Oct 14, 2019
Merged

change secret types example #890

merged 5 commits into from Oct 14, 2019

Conversation

ashears
Copy link
Contributor

@ashears ashears commented Oct 11, 2019

Change Summary

I was examining #884, which discussed the secret types. I found that the example for secret types could be slightly more clear.

Apologies if I am in error with creating this PR, I do not have experience submitting PR to an open source code base.

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 codecov bot commented Oct 11, 2019

Codecov Report

Merging #890 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master   #890   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          16     16           
  Lines        2716   2742   +26     
  Branches      518    521    +3     
=====================================
+ Hits         2716   2742   +26
Impacted Files Coverage Δ
pydantic/error_wrappers.py 100% <0%> (ø) ⬆️
pydantic/types.py 100% <0%> (ø) ⬆️
pydantic/fields.py 100% <0%> (ø) ⬆️
pydantic/typing.py 100% <0%> (ø) ⬆️
pydantic/utils.py 100% <0%> (ø) ⬆️
pydantic/networks.py 100% <0%> (ø) ⬆️
pydantic/schema.py 100% <0%> (ø) ⬆️

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 e7227db...812e8ed. Read the comment docs.

@ashears ashears marked this pull request as ready for review Oct 11, 2019
@dmontagu
Copy link
Collaborator

@dmontagu dmontagu commented Oct 11, 2019

Looks good to me

changes/-.md file added describing change
(see changes/README.md for details)

Feel free to do this if you want credit for your contribution!

Copy link
Owner

@samuelcolvin samuelcolvin left a comment

looks good, but a few small things to change.

Maybe best for me to merge #884 and the PR which changes how print works in examples, which I'm working on today.

print(sm)
#> SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********')
# > SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********')
Copy link
Owner

@samuelcolvin samuelcolvin Oct 14, 2019

Choose a reason for hiding this comment

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

Suggested change
# > SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********')
#> SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********')

and below.

print(sm)
#> SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********')
# > SimpleModel password=SecretStr('**********') password_bytes=SecretBytes(b'**********')
print(sm.password.display())
Copy link
Owner

@samuelcolvin samuelcolvin Oct 14, 2019

Choose a reason for hiding this comment

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

.display() is deprecated after #884 which will be merged before this (try to merge in the order PRs are created unless there's a good reason not to)

Copy link
Contributor Author

@ashears ashears Oct 14, 2019

Choose a reason for hiding this comment

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

Changed to print(str(sm.password))

Copy link
Owner

@samuelcolvin samuelcolvin left a comment

otherwise LGTM.

print(sm)
print(str(sm.password))
Copy link
Owner

@samuelcolvin samuelcolvin Oct 14, 2019

Choose a reason for hiding this comment

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

Suggested change
print(str(sm.password))
print(repr(sm.password))

print(str(x)) is the same as print(x)

@samuelcolvin samuelcolvin merged commit b1e61b4 into samuelcolvin:master Oct 14, 2019
10 checks passed
@samuelcolvin
Copy link
Owner

@samuelcolvin samuelcolvin commented Oct 14, 2019

thank you very much.

andreshndz pushed a commit to cuenca-mx/pydantic that referenced this issue Jan 17, 2020
* change secret types example

* add changes file

* add address review comments

* remove redundant str() call
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.

None yet

3 participants