Skip to content

Commit

Permalink
pandas-dev#56147 removed offset and year end interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmylow committed Jan 11, 2024
1 parent 5955ca6 commit 460afc2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2770,16 +2770,12 @@ def _generate_range(
else:
end = None

# GH #56134 fix bug in end of interval
if start and not offset.is_on_offset(start):
# Incompatible types in assignment (expression has type "datetime",
# variable has type "Optional[Timestamp]")
start = offset.rollforward(start) # type: ignore[assignment]

elif end and not offset.is_on_offset(end):
# Incompatible types in assignment (expression has type "datetime",
# variable has type "Optional[Timestamp]")
end = offset.rollback(end) # type: ignore[assignment]

# Unsupported operand types for < ("Timestamp" and "None")
if periods is None and end < start and offset.n >= 0: # type: ignore[operator]
end = None
Expand Down

0 comments on commit 460afc2

Please sign in to comment.