Skip to content

fix: copy with tzinfo #567

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

Merged
merged 2 commits into from
May 1, 2023
Merged

Conversation

JeanArhancet
Copy link
Contributor

Closes #545

@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2023

Codecov Report

Merging #567 (9959303) into main (43aa422) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #567      +/-   ##
==========================================
- Coverage   94.17%   94.14%   -0.03%     
==========================================
  Files          95       94       -1     
  Lines       12844    12767      -77     
  Branches       24       24              
==========================================
- Hits        12096    12020      -76     
+ Misses        742      741       -1     
  Partials        6        6              
Impacted Files Coverage Δ
src/input/datetime.rs 98.26% <100.00%> (+0.36%) ⬆️

... and 22 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 30, 2023

CodSpeed Performance Report

Merging #567 JeanArhancet:fix/copy-tzinfo (9959303) will not alter performances.

Summary

🔥 0 improvements
❌ 0 regressions
✅ 111 untouched benchmarks

🆕 0 new benchmarks
⁉️ 0 dropped benchmarks

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.

otherwise looks great, thanks for the contribution.

Comment on lines 1 to 2
use super::Input;
use crate::errors::{ErrorType, ValError, ValResult};
Copy link
Member

Choose a reason for hiding this comment

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

please move these down to where they were before, they match the order of other imports.

use pyo3::intern;
use pyo3::prelude::*;
use pyo3::types::PyDict;
Copy link
Member

Choose a reason for hiding this comment

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

please combine this into the line below.

@@ -185,6 +186,14 @@ def test_tz_comparison():
SchemaValidator({'type': 'datetime', 'gt': uk_3pm}).validate_python('2022-01-01T16:00:00+01:00')


def test_tz_info_deepcopy():
output = SchemaValidator({'type': 'datetime'}).validate_python('2023-02-15T16:23:44.037Z')
c = copy.deepcopy(output)
Copy link
Member

Choose a reason for hiding this comment

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

please can you test with copy.copy as well.

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. What do you think?

@samuelcolvin samuelcolvin merged commit 9f69da1 into pydantic:main May 1, 2023
@samuelcolvin
Copy link
Member

Thanks so much, looks great.

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.

Error copying pydantic-core internal TzInfo type
3 participants