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

Fix bug in FiniteDateRange.is_disjoint #112

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

josh-lynch
Copy link
Contributor

Previously if you called is_disjoint on a range containing either
date.min or date.max you would get an OverflowError.

@josh-lynch josh-lynch force-pushed the ranges/bugfix-edge-of-time-handling branch from 40f0dd3 to 844eb65 Compare October 31, 2023 17:06
@josh-lynch josh-lynch force-pushed the ranges/bugfix-edge-of-time-handling branch 2 times, most recently from c33c82d to 2003154 Compare November 1, 2023 09:08
@josh-lynch josh-lynch mentioned this pull request Nov 1, 2023
Previously if you called is_disjoint on a range containing either
date.min or date.max you would get an OverflowError.
@josh-lynch josh-lynch force-pushed the ranges/bugfix-edge-of-time-handling branch from 2003154 to 3bec7eb Compare November 1, 2023 09:19
pydanny
pydanny previously requested changes Nov 1, 2023
Copy link
Contributor

@pydanny pydanny left a comment

Choose a reason for hiding this comment

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

Looks really good! Just please update the version to 4.8.0. Thanks!

@@ -1,5 +1,11 @@
# Changelog

## v4.7.1 - 2023-11-01

- Adding explicit type for Optional OneToOneField [#113](https://github.com/octoenergy/xocto/pull/113)
Copy link
Contributor

Choose a reason for hiding this comment

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

In semver, this is a 4.8.0 change, not 4.7.1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

setup.py Outdated
@@ -6,7 +6,7 @@

REPO_ROOT = path.abspath(path.dirname(__file__))

VERSION = "4.7.0"
VERSION = "4.7.1"

This comment was marked as duplicate.

@@ -1 +1 @@
__version__ = "4.7.0"
__version__ = "4.7.1"

This comment was marked as duplicate.

@@ -811,11 +811,17 @@ def is_disjoint(self, other: Range[datetime.date]) -> bool:
other_start = other.start
if other._is_left_inclusive:
assert other_start is not None
other_start -= datetime.timedelta(days=1)
try:
other_start -= datetime.timedelta(days=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nothing needs to be changed here, merely a comment that I rarely see -=. 🤷🏻

@josh-lynch josh-lynch force-pushed the ranges/bugfix-edge-of-time-handling branch from 3bec7eb to 19ea90e Compare November 1, 2023 09:24
@josh-lynch josh-lynch requested a review from pydanny November 1, 2023 09:25
@josh-lynch josh-lynch dismissed pydanny’s stale review November 1, 2023 10:02

Requested change implemented

@josh-lynch josh-lynch merged commit 1e9147d into main Nov 1, 2023
@josh-lynch josh-lynch deleted the ranges/bugfix-edge-of-time-handling branch November 1, 2023 10:18
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.

4 participants