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

remove DeprecationWarnings from v1 release & fix coverage #2415

Merged
merged 4 commits into from Feb 26, 2021

Conversation

samuelcolvin
Copy link
Member

To fix coverage before v1.8 #2414.

Most of these warnings should have been removed a long time again.

Removed:

  • notes on migrating to v1
  • Schema which was replaced by Field
  • Config.case_insensitive which was replaced by Config. case_sensitive (default False)
  • Config.allow_population_by_alias which was replaced by Config.allow_population_by_field_name
  • model.fields which was replaced by model.__fields__
  • model.to_string() which was replaced by str(model)
  • model.__values__ which was replaced by __dict__

@codecov
Copy link

codecov bot commented Feb 26, 2021

Codecov Report

Merging #2415 (e0e9f9b) into master (8f0980e) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           master     #2415      +/-   ##
===========================================
+ Coverage   99.90%   100.00%   +0.09%     
===========================================
  Files          25        25              
  Lines        5099      5080      -19     
  Branches     1043      1041       -2     
===========================================
- Hits         5094      5080      -14     
+ Misses          1         0       -1     
+ Partials        4         0       -4     
Impacted Files Coverage Δ
pydantic/__init__.py 100.00% <100.00%> (ø)
pydantic/fields.py 100.00% <100.00%> (ø)
pydantic/main.py 100.00% <100.00%> (+0.93%) ⬆️

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 8f0980e...a207b51. Read the comment docs.

return {
'__dict__': self.__dict__,
'__fields_set__': self.__fields_set__,
'__private_attribute_values__': {k: getattr(self, k, Undefined) for k in self.__private_attributes__},
'__private_attribute_values__': {k: v for k, v in private_attrs if v is not Undefined},
Copy link
Member Author

Choose a reason for hiding this comment

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

@MrMrRobat I think you wrote this originally, are you happy with the change.

Basically the if value is not Undefined: below was always True, I because the behaviour of Undefined when pickled has changed slightly.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member Author

Choose a reason for hiding this comment

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

@MrMrRobat do you have any idea why the if value is not Undefined: line in copy() now has partial coverage, but used to be covered.

I'm trying to work out, but it makes no sense.

Sorry, I know it's not your problem but it's really confusing me.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it could perhaps be a change in cython, but I'm not sure. Or it could even be a bug fix in codecov? 😕 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's because now only present attrs are pickled, while in the past missing attrs used to be pickled as Undefined? Just a quick assumption, I didn't dig into new code yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe, it was the same on copy().

Hopefully I fixed the coverage without breaking anything 🤞.

@samuelcolvin samuelcolvin changed the title remove DeprecationWarnings from v1 release remove DeprecationWarnings from v1 release & fix coverage Feb 26, 2021
@samuelcolvin samuelcolvin merged commit 2ee6811 into master Feb 26, 2021
@samuelcolvin samuelcolvin deleted the remove-deprecation-warnings branch February 26, 2021 14:43
samuelcolvin added a commit that referenced this pull request Feb 26, 2021
samuelcolvin added a commit that referenced this pull request Feb 26, 2021
* preparing for v1.8 🎉 🚀

* change description for #2415

* tweak change descriptions

* fix nested lists in docs

* remove items in 1.7.3 from 1.8
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

2 participants