From 7f53ad3d5ee62845aabced56f52f934ba045b575 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Wed, 7 Dec 2022 13:45:11 -0800 Subject: [PATCH 1/5] Revert "CI try using ubuntu20.04 (#50113)" This reverts commit 03a981ae61e685bb6c35234a6fb78a68373af0c6. --- .github/workflows/32-bit-linux.yml | 2 +- .github/workflows/assign.yml | 2 +- .github/workflows/asv-bot.yml | 2 +- .github/workflows/autoupdate-pre-commit-config.yml | 2 +- .github/workflows/code-checks.yml | 10 +++++----- .github/workflows/codeql.yml | 2 +- .github/workflows/docbuild-and-upload.yml | 2 +- .github/workflows/package-checks.yml | 2 +- .github/workflows/python-dev.yml | 2 +- .github/workflows/scorecards.yml | 2 +- .github/workflows/sdist.yml | 2 +- .github/workflows/stale-pr.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/wheels.yml | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/32-bit-linux.yml b/.github/workflows/32-bit-linux.yml index c1004a505ea48..806742c99abac 100644 --- a/.github/workflows/32-bit-linux.yml +++ b/.github/workflows/32-bit-linux.yml @@ -17,7 +17,7 @@ permissions: jobs: pytest: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml index 979cd4679c0a0..b7bb8db549f86 100644 --- a/.github/workflows/assign.yml +++ b/.github/workflows/assign.yml @@ -11,7 +11,7 @@ jobs: permissions: issues: write pull-requests: write - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - if: github.event.comment.body == 'take' run: | diff --git a/.github/workflows/asv-bot.yml b/.github/workflows/asv-bot.yml index f676baa31aa14..abb19a95315b6 100644 --- a/.github/workflows/asv-bot.yml +++ b/.github/workflows/asv-bot.yml @@ -21,7 +21,7 @@ jobs: name: "Run benchmarks" # TODO: Support more benchmarking options later, against different branches, against self, etc if: startsWith(github.event.comment.body, '@github-actions benchmark') - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: shell: bash -el {0} diff --git a/.github/workflows/autoupdate-pre-commit-config.yml b/.github/workflows/autoupdate-pre-commit-config.yml index 4de8b35f93a69..5963e819c0dae 100644 --- a/.github/workflows/autoupdate-pre-commit-config.yml +++ b/.github/workflows/autoupdate-pre-commit-config.yml @@ -15,7 +15,7 @@ jobs: pull-requests: write # for technote-space/create-pr-action to create a PR if: github.repository_owner == 'pandas-dev' name: Autoupdate pre-commit config - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index 0f1f254b571a6..91deb7f517ca7 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -20,7 +20,7 @@ permissions: jobs: pre_commit: name: pre-commit - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest concurrency: # https://github.community/t/concurrecy-not-work-for-push/183068/7 group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pre-commit @@ -41,7 +41,7 @@ jobs: docstring_typing_pylint: name: Docstring validation, typing, and pylint - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: shell: bash -el {0} @@ -104,7 +104,7 @@ jobs: asv-benchmarks: name: ASV Benchmarks - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: shell: bash -el {0} @@ -135,7 +135,7 @@ jobs: build_docker_dev_environment: name: Build Docker Dev Environment - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: shell: bash -el {0} @@ -162,7 +162,7 @@ jobs: requirements-dev-text-installable: name: Test install requirements-dev.txt - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest concurrency: # https://github.community/t/concurrecy-not-work-for-push/183068/7 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index dfe6b0574b20a..457aa69fb924f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,7 +10,7 @@ concurrency: jobs: analyze: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest permissions: actions: read contents: read diff --git a/.github/workflows/docbuild-and-upload.yml b/.github/workflows/docbuild-and-upload.yml index 13c51f2cc8550..d95de5deb3cdf 100644 --- a/.github/workflows/docbuild-and-upload.yml +++ b/.github/workflows/docbuild-and-upload.yml @@ -22,7 +22,7 @@ permissions: jobs: web_and_docs: name: Doc Build and Upload - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest concurrency: # https://github.community/t/concurrecy-not-work-for-push/183068/7 diff --git a/.github/workflows/package-checks.yml b/.github/workflows/package-checks.yml index d46a1302424ab..070d7b3a71bc7 100644 --- a/.github/workflows/package-checks.yml +++ b/.github/workflows/package-checks.yml @@ -17,7 +17,7 @@ permissions: jobs: pip: if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: extra: ["test", "performance", "timezone", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"] diff --git a/.github/workflows/python-dev.yml b/.github/workflows/python-dev.yml index 706d1511940bb..88f3d16a73a1a 100644 --- a/.github/workflows/python-dev.yml +++ b/.github/workflows/python-dev.yml @@ -49,7 +49,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest, windows-latest] name: actions-311-dev timeout-minutes: 120 diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index af4af94996c43..1eedfe5b8ab51 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -13,7 +13,7 @@ permissions: read-all jobs: analysis: name: Scorecards analysis - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest permissions: # Needed to upload the results to code-scanning dashboard. security-events: write diff --git a/.github/workflows/sdist.yml b/.github/workflows/sdist.yml index 984723b19dadf..c9ac218bff935 100644 --- a/.github/workflows/sdist.yml +++ b/.github/workflows/sdist.yml @@ -19,7 +19,7 @@ permissions: jobs: build: if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest timeout-minutes: 60 defaults: run: diff --git a/.github/workflows/stale-pr.yml b/.github/workflows/stale-pr.yml index 3a555de8eadbe..69656be18a8b1 100644 --- a/.github/workflows/stale-pr.yml +++ b/.github/workflows/stale-pr.yml @@ -11,7 +11,7 @@ jobs: stale: permissions: pull-requests: write - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/stale@v4 with: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 733d095f7329e..69bde1d812e07 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -20,7 +20,7 @@ permissions: jobs: pytest: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: shell: bash -el {0} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 75acf97697257..b0ff6a3110f6a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -127,7 +127,7 @@ jobs: (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Build')) || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0'))) - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} From d596e01cbe0802d1e03f070e6e57181602fe67bc Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Wed, 7 Dec 2022 13:45:55 -0800 Subject: [PATCH 2/5] removed dead cython code --- pandas/_libs/tslibs/parsing.pyx | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/pandas/_libs/tslibs/parsing.pyx b/pandas/_libs/tslibs/parsing.pyx index 44d06df53e0be..f989325417c2e 100644 --- a/pandas/_libs/tslibs/parsing.pyx +++ b/pandas/_libs/tslibs/parsing.pyx @@ -444,7 +444,7 @@ cdef parse_datetime_string_with_reso( try: parsed, reso = dateutil_parse(date_string, _DEFAULT_DATETIME, dayfirst=dayfirst, yearfirst=yearfirst, - ignoretz=False, tzinfos=None) + ignoretz=False) except (ValueError, OverflowError) as err: # TODO: allow raise of errors within instead raise DateParseError(err) @@ -636,7 +636,6 @@ cdef dateutil_parse( str timestr, object default, bint ignoretz=False, - object tzinfos=None, bint dayfirst=False, bint yearfirst=False, ): @@ -674,24 +673,7 @@ cdef dateutil_parse( if res.weekday is not None and not res.day: ret = ret + relativedelta.relativedelta(weekday=res.weekday) if not ignoretz: - if callable(tzinfos) or tzinfos and res.tzname in tzinfos: - # Note: as of 1.0 this is not reached because - # we never pass tzinfos, see GH#22234 - if callable(tzinfos): - tzdata = tzinfos(res.tzname, res.tzoffset) - else: - tzdata = tzinfos.get(res.tzname) - if isinstance(tzdata, tzinfo): - new_tzinfo = tzdata - elif isinstance(tzdata, str): - new_tzinfo = _dateutil_tzstr(tzdata) - elif isinstance(tzdata, int): - new_tzinfo = tzoffset(res.tzname, tzdata) - else: - raise ValueError("offset must be tzinfo subclass, " - "tz string, or int offset") - ret = ret.replace(tzinfo=new_tzinfo) - elif res.tzname and res.tzname in time.tzname: + if res.tzname and res.tzname in time.tzname: ret = ret.replace(tzinfo=_dateutil_tzlocal()) elif res.tzoffset == 0: ret = ret.replace(tzinfo=_dateutil_tzutc()) From 9bc28a086676447b052f32a30db0631587a2d4f9 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Thu, 8 Dec 2022 15:41:02 -0800 Subject: [PATCH 3/5] fix warning --- pandas/_libs/tslibs/offsets.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 482cf91c92b70..9441f87097f4a 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -4132,7 +4132,7 @@ def shift_months( cnp.broadcast mi = cnp.PyArray_MultiIterNew2(out, dtindex) - if day_opt not in [None, "start", "end", "business_start", "business_end"]: + if day_opt is not None and day_opt not in {"start", "end", "business_start", "business_end"}: raise ValueError("day must be None, 'start', 'end', " "'business_start', or 'business_end'") From 99d0f2181ed4b7a8cb4984d994fce9866dcac647 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Thu, 8 Dec 2022 15:45:31 -0800 Subject: [PATCH 4/5] ci to ubuntu 22.04 --- .github/workflows/32-bit-linux.yml | 2 +- .github/workflows/assign.yml | 2 +- .github/workflows/asv-bot.yml | 2 +- .github/workflows/autoupdate-pre-commit-config.yml | 2 +- .github/workflows/code-checks.yml | 10 +++++----- .github/workflows/codeql.yml | 2 +- .github/workflows/docbuild-and-upload.yml | 2 +- .github/workflows/package-checks.yml | 2 +- .github/workflows/python-dev.yml | 2 +- .github/workflows/scorecards.yml | 2 +- .github/workflows/sdist.yml | 2 +- .github/workflows/stale-pr.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/wheels.yml | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/32-bit-linux.yml b/.github/workflows/32-bit-linux.yml index 806742c99abac..438d2c7b4174e 100644 --- a/.github/workflows/32-bit-linux.yml +++ b/.github/workflows/32-bit-linux.yml @@ -17,7 +17,7 @@ permissions: jobs: pytest: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml index b7bb8db549f86..b3331060823a9 100644 --- a/.github/workflows/assign.yml +++ b/.github/workflows/assign.yml @@ -11,7 +11,7 @@ jobs: permissions: issues: write pull-requests: write - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - if: github.event.comment.body == 'take' run: | diff --git a/.github/workflows/asv-bot.yml b/.github/workflows/asv-bot.yml index abb19a95315b6..d264698e60485 100644 --- a/.github/workflows/asv-bot.yml +++ b/.github/workflows/asv-bot.yml @@ -21,7 +21,7 @@ jobs: name: "Run benchmarks" # TODO: Support more benchmarking options later, against different branches, against self, etc if: startsWith(github.event.comment.body, '@github-actions benchmark') - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 defaults: run: shell: bash -el {0} diff --git a/.github/workflows/autoupdate-pre-commit-config.yml b/.github/workflows/autoupdate-pre-commit-config.yml index 5963e819c0dae..376aa8343c571 100644 --- a/.github/workflows/autoupdate-pre-commit-config.yml +++ b/.github/workflows/autoupdate-pre-commit-config.yml @@ -15,7 +15,7 @@ jobs: pull-requests: write # for technote-space/create-pr-action to create a PR if: github.repository_owner == 'pandas-dev' name: Autoupdate pre-commit config - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index 91deb7f517ca7..d1bc51cecc886 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -20,7 +20,7 @@ permissions: jobs: pre_commit: name: pre-commit - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 concurrency: # https://github.community/t/concurrecy-not-work-for-push/183068/7 group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pre-commit @@ -41,7 +41,7 @@ jobs: docstring_typing_pylint: name: Docstring validation, typing, and pylint - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 defaults: run: shell: bash -el {0} @@ -104,7 +104,7 @@ jobs: asv-benchmarks: name: ASV Benchmarks - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 defaults: run: shell: bash -el {0} @@ -135,7 +135,7 @@ jobs: build_docker_dev_environment: name: Build Docker Dev Environment - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 defaults: run: shell: bash -el {0} @@ -162,7 +162,7 @@ jobs: requirements-dev-text-installable: name: Test install requirements-dev.txt - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 concurrency: # https://github.community/t/concurrecy-not-work-for-push/183068/7 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 457aa69fb924f..05a5d003c1dd1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,7 +10,7 @@ concurrency: jobs: analyze: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: actions: read contents: read diff --git a/.github/workflows/docbuild-and-upload.yml b/.github/workflows/docbuild-and-upload.yml index d95de5deb3cdf..ee79c10c12d4e 100644 --- a/.github/workflows/docbuild-and-upload.yml +++ b/.github/workflows/docbuild-and-upload.yml @@ -22,7 +22,7 @@ permissions: jobs: web_and_docs: name: Doc Build and Upload - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 concurrency: # https://github.community/t/concurrecy-not-work-for-push/183068/7 diff --git a/.github/workflows/package-checks.yml b/.github/workflows/package-checks.yml index 070d7b3a71bc7..eb065c6e2e87d 100644 --- a/.github/workflows/package-checks.yml +++ b/.github/workflows/package-checks.yml @@ -17,7 +17,7 @@ permissions: jobs: pip: if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: extra: ["test", "performance", "timezone", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"] diff --git a/.github/workflows/python-dev.yml b/.github/workflows/python-dev.yml index 88f3d16a73a1a..220c1e464742e 100644 --- a/.github/workflows/python-dev.yml +++ b/.github/workflows/python-dev.yml @@ -49,7 +49,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-22.04, macOS-latest, windows-latest] name: actions-311-dev timeout-minutes: 120 diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 1eedfe5b8ab51..ac5710fc8879b 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -13,7 +13,7 @@ permissions: read-all jobs: analysis: name: Scorecards analysis - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: # Needed to upload the results to code-scanning dashboard. security-events: write diff --git a/.github/workflows/sdist.yml b/.github/workflows/sdist.yml index c9ac218bff935..d11b614e2b2c0 100644 --- a/.github/workflows/sdist.yml +++ b/.github/workflows/sdist.yml @@ -19,7 +19,7 @@ permissions: jobs: build: if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 60 defaults: run: diff --git a/.github/workflows/stale-pr.yml b/.github/workflows/stale-pr.yml index 69656be18a8b1..c47745e097d17 100644 --- a/.github/workflows/stale-pr.yml +++ b/.github/workflows/stale-pr.yml @@ -11,7 +11,7 @@ jobs: stale: permissions: pull-requests: write - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/stale@v4 with: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 69bde1d812e07..7b4d9235f7ee1 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -20,7 +20,7 @@ permissions: jobs: pytest: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 defaults: run: shell: bash -el {0} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b0ff6a3110f6a..49d29c91f86cd 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -127,7 +127,7 @@ jobs: (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Build')) || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0'))) - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} From 213a0580bdb5a4b5ed1f082884748079f3d11112 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Thu, 8 Dec 2022 15:48:15 -0800 Subject: [PATCH 5/5] cython fixups --- pandas/_libs/tslibs/offsets.pyx | 4 +++- pandas/_libs/tslibs/parsing.pyx | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 9441f87097f4a..b80af0d3e158b 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -4132,7 +4132,9 @@ def shift_months( cnp.broadcast mi = cnp.PyArray_MultiIterNew2(out, dtindex) - if day_opt is not None and day_opt not in {"start", "end", "business_start", "business_end"}: + if day_opt is not None and day_opt not in { + "start", "end", "business_start", "business_end" + }: raise ValueError("day must be None, 'start', 'end', " "'business_start', or 'business_end'") diff --git a/pandas/_libs/tslibs/parsing.pyx b/pandas/_libs/tslibs/parsing.pyx index f989325417c2e..7ae6dad58a1d9 100644 --- a/pandas/_libs/tslibs/parsing.pyx +++ b/pandas/_libs/tslibs/parsing.pyx @@ -12,7 +12,6 @@ from cpython.datetime cimport ( datetime, datetime_new, import_datetime, - tzinfo, ) from cpython.object cimport PyObject_Str from cython cimport Py_ssize_t @@ -44,7 +43,6 @@ from dateutil.relativedelta import relativedelta from dateutil.tz import ( tzlocal as _dateutil_tzlocal, tzoffset, - tzstr as _dateutil_tzstr, tzutc as _dateutil_tzutc, ) @@ -644,7 +642,7 @@ cdef dateutil_parse( cdef: str attr datetime ret - object res, tzdata + object res object reso = None dict repl = {}