Skip to content

Commit ccce437

Browse files
Backport PR #50117 on branch 1.5.x (Alternate Ubuntu CI fix) (#50277)
Backport PR #50117: Alternate Ubuntu CI fix Co-authored-by: William Ayd <[email protected]>
1 parent f67d0b7 commit ccce437

13 files changed

+21
-39
lines changed

.github/workflows/32-bit-linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
pytest:
20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-22.04
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v3

.github/workflows/assign.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
issues: write
1313
pull-requests: write
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- if: github.event.comment.body == 'take'
1717
run: |

.github/workflows/asv-bot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
name: "Run benchmarks"
2222
# TODO: Support more benchmarking options later, against different branches, against self, etc
2323
if: startsWith(github.event.comment.body, '@github-actions benchmark')
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525
defaults:
2626
run:
2727
shell: bash -el {0}

.github/workflows/autoupdate-pre-commit-config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
pull-requests: write # for technote-space/create-pr-action to create a PR
1616
if: github.repository_owner == 'pandas-dev'
1717
name: Autoupdate pre-commit config
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-22.04
1919
steps:
2020
- name: Set up Python
2121
uses: actions/setup-python@v4

.github/workflows/code-checks.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020
jobs:
2121
pre_commit:
2222
name: pre-commit
23-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-22.04
2424
concurrency:
2525
# https://github.community/t/concurrecy-not-work-for-push/183068/7
2626
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pre-commit
@@ -39,7 +39,7 @@ jobs:
3939

4040
typing_and_docstring_validation:
4141
name: Docstring and typing validation
42-
runs-on: ubuntu-20.04
42+
runs-on: ubuntu-22.04
4343
defaults:
4444
run:
4545
shell: bash -el {0}
@@ -98,7 +98,7 @@ jobs:
9898

9999
asv-benchmarks:
100100
name: ASV Benchmarks
101-
runs-on: ubuntu-20.04
101+
runs-on: ubuntu-22.04
102102
defaults:
103103
run:
104104
shell: bash -el {0}
@@ -129,7 +129,7 @@ jobs:
129129
130130
build_docker_dev_environment:
131131
name: Build Docker Dev Environment
132-
runs-on: ubuntu-20.04
132+
runs-on: ubuntu-22.04
133133
defaults:
134134
run:
135135
shell: bash -el {0}
@@ -156,7 +156,7 @@ jobs:
156156

157157
requirements-dev-text-installable:
158158
name: Test install requirements-dev.txt
159-
runs-on: ubuntu-20.04
159+
runs-on: ubuntu-22.04
160160

161161
concurrency:
162162
# https://github.community/t/concurrecy-not-work-for-push/183068/7

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
jobs:
1212
analyze:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-22.04
1414
permissions:
1515
actions: read
1616
contents: read

.github/workflows/docbuild-and-upload.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ permissions:
2222
jobs:
2323
web_and_docs:
2424
name: Doc Build and Upload
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-22.04
2626

2727
concurrency:
2828
# https://github.community/t/concurrecy-not-work-for-push/183068/7

.github/workflows/python-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
fail-fast: false
5151
matrix:
52-
os: [ubuntu-20.04, macOS-latest, windows-latest]
52+
os: [ubuntu-22.04, macOS-latest, windows-latest]
5353

5454
name: actions-311-dev
5555
timeout-minutes: 120

.github/workflows/sdist.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919
jobs:
2020
build:
2121
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-22.04
2323
timeout-minutes: 60
2424
defaults:
2525
run:

.github/workflows/stale-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
stale:
1212
permissions:
1313
pull-requests: write
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/stale@v4
1717
with:

.github/workflows/ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020

2121
jobs:
2222
pytest:
23-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-22.04
2424
defaults:
2525
run:
2626
shell: bash -el {0}

pandas/_libs/tslibs/offsets.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -4134,7 +4134,9 @@ def shift_months(
41344134

41354135
cnp.broadcast mi = cnp.PyArray_MultiIterNew2(out, dtindex)
41364136

4137-
if day_opt not in [None, "start", "end", "business_start", "business_end"]:
4137+
if day_opt is not None and day_opt not in {
4138+
"start", "end", "business_start", "business_end"
4139+
}:
41384140
raise ValueError("day must be None, 'start', 'end', "
41394141
"'business_start', or 'business_end'")
41404142

pandas/_libs/tslibs/parsing.pyx

+3-23
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ from cpython.datetime cimport (
1212
datetime,
1313
datetime_new,
1414
import_datetime,
15-
tzinfo,
1615
)
1716
from cpython.object cimport PyObject_Str
1817
from cython cimport Py_ssize_t
@@ -44,7 +43,6 @@ from dateutil.relativedelta import relativedelta
4443
from dateutil.tz import (
4544
tzlocal as _dateutil_tzlocal,
4645
tzoffset,
47-
tzstr as _dateutil_tzstr,
4846
tzutc as _dateutil_tzutc,
4947
)
5048

@@ -441,7 +439,7 @@ cdef parse_datetime_string_with_reso(
441439
try:
442440
parsed, reso = dateutil_parse(date_string, _DEFAULT_DATETIME,
443441
dayfirst=dayfirst, yearfirst=yearfirst,
444-
ignoretz=False, tzinfos=None)
442+
ignoretz=False)
445443
except (ValueError, OverflowError) as err:
446444
# TODO: allow raise of errors within instead
447445
raise DateParseError(err)
@@ -633,7 +631,6 @@ cdef dateutil_parse(
633631
str timestr,
634632
object default,
635633
bint ignoretz=False,
636-
object tzinfos=None,
637634
bint dayfirst=False,
638635
bint yearfirst=False,
639636
):
@@ -642,7 +639,7 @@ cdef dateutil_parse(
642639
cdef:
643640
str attr
644641
datetime ret
645-
object res, tzdata
642+
object res
646643
object reso = None
647644
dict repl = {}
648645

@@ -671,24 +668,7 @@ cdef dateutil_parse(
671668
if res.weekday is not None and not res.day:
672669
ret = ret + relativedelta.relativedelta(weekday=res.weekday)
673670
if not ignoretz:
674-
if callable(tzinfos) or tzinfos and res.tzname in tzinfos:
675-
# Note: as of 1.0 this is not reached because
676-
# we never pass tzinfos, see GH#22234
677-
if callable(tzinfos):
678-
tzdata = tzinfos(res.tzname, res.tzoffset)
679-
else:
680-
tzdata = tzinfos.get(res.tzname)
681-
if isinstance(tzdata, tzinfo):
682-
new_tzinfo = tzdata
683-
elif isinstance(tzdata, str):
684-
new_tzinfo = _dateutil_tzstr(tzdata)
685-
elif isinstance(tzdata, int):
686-
new_tzinfo = tzoffset(res.tzname, tzdata)
687-
else:
688-
raise ValueError("offset must be tzinfo subclass, "
689-
"tz string, or int offset")
690-
ret = ret.replace(tzinfo=new_tzinfo)
691-
elif res.tzname and res.tzname in time.tzname:
671+
if res.tzname and res.tzname in time.tzname:
692672
ret = ret.replace(tzinfo=_dateutil_tzlocal())
693673
elif res.tzoffset == 0:
694674
ret = ret.replace(tzinfo=_dateutil_tzutc())

0 commit comments

Comments
 (0)