Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Restore behavior of setting fields to values derived from date, time #1377

Merged
merged 4 commits into from
Apr 16, 2024

Conversation

sgillies
Copy link
Member

Resolves #1376

@sgillies sgillies added the bug label Apr 15, 2024
@sgillies sgillies added this to the 1.10 milestone Apr 15, 2024
@sgillies sgillies self-assigned this Apr 15, 2024
val_type = type(value)

if val_type in self.property_setter_cache:
setter = self.property_setter_cache[val_type]
Copy link
Member Author

@sgillies sgillies Apr 15, 2024

Choose a reason for hiding this comment

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

In a nutshell: the code in 1.9 tested elif isinstance(value, (date, time, datetime) before calling a field setter. In 1.10 we will register setters to names like "date" and use the MRO of type(value) to look up and cache a setter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Look okay to you @mwtoews ?

@sgillies sgillies requested a review from mwtoews April 15, 2024 23:48
@sgillies sgillies merged commit b6e62cc into main Apr 16, 2024
8 checks passed
@sgillies sgillies deleted the issue1376 branch April 16, 2024 15:33
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fiona no longer recognizes pd.Timestamp (as datetime.datetime) since 1.10 a2
2 participants