Skip to content

Conversation

Tishj
Copy link
Contributor

@Tishj Tishj commented Nov 15, 2023

This PR fixes #9431

What we used to do was convert days to months by dividing with a constant.
This constant is lossy however, and should not be used in this way.

The issue shows the result of this.

What we do now is create separate INTERVAL values from the components of the timedelta and use the existing addition mechanism to add these together to form the result.

Tishj added 2 commits November 7, 2023 18:41
…or, they should be identical. Also check that SQL INTERVAL constants are equal to the identical datetime.timedelta variant
@Mytherin Mytherin merged commit 958f189 into duckdb:main Nov 16, 2023
@Mytherin
Copy link
Collaborator

Thanks! LGTM

krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Dec 11, 2023
Merge pull request duckdb/duckdb#9688 from Tishj/python_fix_timedelta_conversion
Merge pull request duckdb/duckdb#9693 from szarnyasg/update-issue-template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python interval bindings gain extra days
2 participants