diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml deleted file mode 100644 index 294091ec9852e..0000000000000 --- a/.github/workflows/database.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Database - -on: - push: - branches: - - master - - 1.3.x - pull_request: - branches: - - master - - 1.3.x - paths-ignore: - - "doc/**" - -env: - PYTEST_WORKERS: "auto" - PANDAS_CI: 1 - PATTERN: ((not slow and not network and not clipboard) or (single and db)) - COVERAGE: true - -jobs: - Linux_py38_IO: - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - - strategy: - matrix: - ENV_FILE: [ci/deps/actions-38-db-min.yaml, ci/deps/actions-38-db.yaml] - fail-fast: false - - concurrency: - # https://github.community/t/concurrecy-not-work-for-push/183068/7 - group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.ENV_FILE }} - cancel-in-progress: true - - services: - mysql: - image: mysql - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: pandas - options: >- - --health-cmd "mysqladmin ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 3306:3306 - - postgres: - image: postgres - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: pandas - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - - moto: - image: motoserver/moto - env: - AWS_ACCESS_KEY_ID: foobar_key - AWS_SECRET_ACCESS_KEY: foobar_secret - ports: - - 5000:5000 - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Cache conda - uses: actions/cache@v2 - env: - CACHE_NUMBER: 0 - with: - path: ~/conda_pkgs_dir - key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ - hashFiles('${{ matrix.ENV_FILE }}') }} - - - uses: conda-incubator/setup-miniconda@v2 - with: - mamba-version: "*" - channels: conda-forge - activate-environment: pandas-dev - channel-priority: strict - environment-file: ${{ matrix.ENV_FILE }} - use-only-tar-bz2: true - - - name: Build Pandas - uses: ./.github/actions/build_pandas - - - name: Test - run: pytest -m "${{ env.PATTERN }}" -n 2 --dist=loadfile --cov=pandas --cov-report=xml pandas/tests/io - if: always() - - - name: Build Version - run: pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd - - - name: Publish test results - uses: actions/upload-artifact@master - with: - name: Test results - path: test-data.xml - if: failure() - - - name: Print skipped tests - run: python ci/print_skipped.py - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - flags: unittests - name: codecov-pandas - fail_ci_if_error: true diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index 3fa9341bd0fef..2a40be680c681 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -25,6 +25,8 @@ jobs: strategy: matrix: settings: [ + [actions-38-db-min.yaml, "((not slow and not network and not clipboard) or (single and db))", "", "", "", "", ""], + [actions-38-db.yaml, "((not slow and not network and not clipboard) or (single and db))", "", "", "", "", ""], [actions-38-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""], [actions-38-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""], [actions-38.yaml, "not slow and not clipboard", "", "", "", "", ""], @@ -52,7 +54,35 @@ jobs: # https://github.community/t/concurrecy-not-work-for-push/183068/7 group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }} cancel-in-progress: true + services: + mysql: + image: mysql + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: pandas + options: >- + --health-cmd "mysqladmin ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 3306:3306 + + postgres: + image: postgres + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: pandas + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + moto: image: motoserver/moto env: diff --git a/pandas/tests/arrays/floating/test_construction.py b/pandas/tests/arrays/floating/test_construction.py index 169b23c31f863..6fa3744429e5d 100644 --- a/pandas/tests/arrays/floating/test_construction.py +++ b/pandas/tests/arrays/floating/test_construction.py @@ -5,7 +5,7 @@ from pandas.compat import ( is_platform_windows, - np_version_under1p19, + np_version_under1p20, ) import pandas as pd @@ -56,7 +56,7 @@ def test_floating_array_disallows_float16(request): with pytest.raises(TypeError, match=msg): FloatingArray(arr, mask) - if np_version_under1p19 or ( + if np_version_under1p20 or ( locale.getlocale()[0] != "en_US" and not is_platform_windows() ): # the locale condition may need to be refined; this fails on diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index 013af7eb90cd3..cc1917933ee6e 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -44,6 +44,7 @@ from pandas.core.arrays import DatetimeArray from pandas.core.tools import datetimes as tools from pandas.core.tools.datetimes import start_caching_at +from pandas.util.version import Version @pytest.fixture(params=[True, False]) @@ -810,11 +811,20 @@ def test_to_datetime_utc_true_with_series_datetime_ns(self, cache, date, dtype): tm.assert_series_equal(result, expected) @td.skip_if_no("psycopg2") - def test_to_datetime_tz_psycopg2(self, cache): + def test_to_datetime_tz_psycopg2(self, request, cache): # xref 8260 import psycopg2 + # https://www.psycopg.org/docs/news.html#what-s-new-in-psycopg-2-9 + request.node.add_marker( + pytest.mark.xfail( + Version(psycopg2.__version__.split()[0]) > Version("2.8.7"), + raises=AttributeError, + reason="psycopg2.tz is deprecated (and appears dropped) in 2.9", + ) + ) + # misc cases tz1 = psycopg2.tz.FixedOffsetTimezone(offset=-300, name=None) tz2 = psycopg2.tz.FixedOffsetTimezone(offset=-240, name=None)