arrow-py / arrow-py/arrow

`span_range` produces questionable output following DST time change

Open
#1,097 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
9.1k
Forks
784
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

I believe the `span_range` function produces erroneous output stemming from the time change to DST in the US.

In the example below at ndx=1, the upper bound for the span is `` when I believe it should be ``.

```
>>> for ndx, x in enumerate(arrow.Arrow.span_range(frame='hour', start=arrow.get('2022-03-13T00:00:00-05:00', tzinfo='US/Eastern'), end=arrow.get('2022-03-14T00:00:00-04:00', tzinfo='US/Eastern'), tz='US/Eastern')):
... print(f"{ndx}: {x}")
...
0: (, )
1: (, )
2: (, )
3: (, )
```

## System Info

- 🖥 **OS name and version**: Ubuntu 18.04.6 LTS
- 🐍 **Python version**: Python 3.6.9
- 🏹 **Arrow version**: arrow==1.2.2

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating Arrow's span_range implementation and reproducing the supplied US/Eastern DST example on the affected version. Compare each returned span with the issue's expected upper bound and verify that the corrected output no longer produces overlapping or duplicated hourly ranges.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.