Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into cow_array_eas
Browse files Browse the repository at this point in the history
# Conflicts:
#	pandas/tests/copy_view/test_array.py
  • Loading branch information
phofl committed Mar 29, 2023
2 parents 2d8a2f2 + 2736ec8 commit 42368e0
Show file tree
Hide file tree
Showing 317 changed files with 5,815 additions and 3,967 deletions.
3 changes: 1 addition & 2 deletions .circleci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ if pip list | grep -q ^pandas; then
fi

echo "Build extensions"
# GH 47305: Parallel build can causes flaky ImportError from pandas/_libs/tslibs
python setup.py build_ext -q -j1
python setup.py build_ext -q -j4

echo "Install pandas"
python -m pip install --no-build-isolation --no-use-pep517 -e .
Expand Down
6 changes: 2 additions & 4 deletions .github/actions/build_pandas/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ runs:
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
shell: bash -el {0}
env:
# Cannot use parallel compilation on Windows, see https://github.com/pandas-dev/pandas/issues/30873
# GH 47305: Parallel build causes flaky ImportError: /home/runner/work/pandas/pandas/pandas/_libs/tslibs/timestamps.cpython-38-x86_64-linux-gnu.so: undefined symbol: pandas_datetime_to_datetimestruct
N_JOBS: 1
#N_JOBS: ${{ runner.os == 'Windows' && 1 || 2 }}
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
N_JOBS: ${{ runner.os == 'macOS' && 3 || 2 }}
2 changes: 1 addition & 1 deletion .github/actions/setup-conda/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
environment-name: ${{ inputs.environment-name }}
extra-specs: ${{ inputs.extra-specs }}
channels: conda-forge
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
channel-priority: 'strict'
condarc-file: ci/condarc.yml
cache-env: true
cache-downloads: true
2 changes: 1 addition & 1 deletion .github/workflows/32-bit-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
python -m pip install versioneer[toml] && \
python -m pip install cython numpy python-dateutil pytz pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.34.2 && \
python setup.py build_ext -q -j1 && \
python setup.py build_ext -q -j$(nproc) && \
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
python -m pip list && \
export PANDAS_CI=1 && \
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
labels:
- "CI"
- "Dependencies"
2 changes: 1 addition & 1 deletion .github/workflows/package-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
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"]
extra: ["test", "performance", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"]
fail-fast: false
name: Install Extras - ${{ matrix.extra }}
concurrency:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/python-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ jobs:
python -m pip install python-dateutil pytz cython hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-cov pytest-asyncio>=0.17
python -m pip list
# GH 47305: Parallel build can cause flaky ImportError from pandas/_libs/tslibs
- name: Build Pandas
run: |
python setup.py build_ext -q -j1
python setup.py build_ext -q -j4
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
- name: Build Version
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml, actions-311.yaml]
pattern: ["not single_cpu", "single_cpu"]
pyarrow_version: ["8", "9", "10"]
pandas_ci: [1]
include:
- name: "Downstream Compat"
env_file: actions-38-downstream_compat.yaml
Expand Down Expand Up @@ -75,7 +74,7 @@ jobs:
test_args: "-W error::DeprecationWarning -W error::FutureWarning"
# TODO(cython3): Re-enable once next-beta(after beta 1) comes out
# There are some warnings failing the build with -werror
pandas_ci: 0
pandas_ci: "0"
exclude:
- env_file: actions-38.yaml
pyarrow_version: "8"
Expand All @@ -99,7 +98,7 @@ jobs:
LC_ALL: ${{ matrix.lc_all || '' }}
PANDAS_DATA_MANAGER: ${{ matrix.pandas_data_manager || 'block' }}
PANDAS_COPY_ON_WRITE: ${{ matrix.pandas_copy_on_write || '0' }}
PANDAS_CI: ${{ matrix.pandas_ci }}
PANDAS_CI: ${{ matrix.pandas_ci || '1' }}
TEST_ARGS: ${{ matrix.test_args || '' }}
PYTEST_WORKERS: ${{ contains(matrix.pattern, 'not single_cpu') && 'auto' || '1' }}
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ dist
# type checkers
pandas/py.typed

# pyenv
.python-version

# tox testing tool
.tox
# rope
Expand Down
14 changes: 3 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
types_or: [python, pyi]
additional_dependencies: [black==23.1.0]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.253
rev: v0.0.259
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down Expand Up @@ -392,14 +392,6 @@ repos:
files: ^pandas/
exclude: ^(pandas/_libs/|pandas/tests/|pandas/errors/__init__.py$|pandas/_version.py)
types: [python]
- id: flake8-pyi
name: flake8-pyi
entry: flake8 --extend-ignore=E301,E302,E305,E701,E704
types: [pyi]
language: python
additional_dependencies:
- flake8==5.0.4
- flake8-pyi==22.8.1
- id: future-annotations
name: import annotations from __future__
entry: 'from __future__ import annotations'
Expand All @@ -421,8 +413,8 @@ repos:
language: python
stages: [manual]
additional_dependencies:
- autotyping==22.9.0
- libcst==0.4.7
- autotyping==23.3.0
- libcst==0.4.9
- id: check-test-naming
name: check that test names start with 'test'
entry: python -m scripts.check_test_naming
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ prune pandas/tests/io/parser/data
# Selectively re-add *.cxx files that were excluded above
graft pandas/_libs/src
graft pandas/_libs/tslibs/src
include pandas/_libs/pd_parser.h
include pandas/_libs/pd_parser.c
4 changes: 4 additions & 0 deletions asv_bench/benchmarks/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,14 @@ def setup(self, tz):
self.ts = self.s[halfway]

self.s2 = Series(date_range("20010101", periods=N, freq="s", tz=tz))
self.ts_different_reso = Timestamp("2001-01-02", tz=tz)

def time_series_timestamp_compare(self, tz):
self.s <= self.ts

def time_series_timestamp_different_reso_compare(self, tz):
self.s <= self.ts_different_reso

def time_timestamp_series_compare(self, tz):
self.ts >= self.s

Expand Down
7 changes: 0 additions & 7 deletions asv_bench/benchmarks/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def setup(self, dtype):

# GH37371. Testing construction of string series/frames from ExtensionArrays
self.series_cat_arr = Categorical(self.series_arr)
self.frame_cat_arr = Categorical(self.frame_arr)

def time_series_construction(self, dtype):
Series(self.series_arr, dtype=dtype)
Expand All @@ -54,12 +53,6 @@ def time_cat_series_construction(self, dtype):
def peakmem_cat_series_construction(self, dtype):
Series(self.series_cat_arr, dtype=dtype)

def time_cat_frame_construction(self, dtype):
DataFrame(self.frame_cat_arr, dtype=dtype)

def peakmem_cat_frame_construction(self, dtype):
DataFrame(self.frame_cat_arr, dtype=dtype)


class Methods(Dtypes):
def time_center(self, dtype):
Expand Down
9 changes: 4 additions & 5 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
MSG='Partially validate docstrings (EX01)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01 --ignore_functions \
pandas.Series.index \
pandas.Series.hasnans \
pandas.Series.to_list \
pandas.Series.__iter__ \
pandas.Series.keys \
pandas.Series.item \
Expand All @@ -97,6 +95,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.Series.is_monotonic_increasing \
pandas.Series.is_monotonic_decreasing \
pandas.Series.backfill \
pandas.Series.bfill \
pandas.Series.ffill \
pandas.Series.pad \
pandas.Series.argsort \
pandas.Series.reorder_levels \
Expand Down Expand Up @@ -307,7 +307,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas_object \
pandas.api.interchange.from_dataframe \
pandas.Index.values \
pandas.Index.hasnans \
pandas.Index.dtype \
pandas.Index.inferred_type \
pandas.Index.shape \
Expand Down Expand Up @@ -541,14 +540,14 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.DataFrame.iterrows \
pandas.DataFrame.pipe \
pandas.DataFrame.backfill \
pandas.DataFrame.bfill \
pandas.DataFrame.ffill \
pandas.DataFrame.pad \
pandas.DataFrame.swapaxes \
pandas.DataFrame.first_valid_index \
pandas.DataFrame.last_valid_index \
pandas.DataFrame.attrs \
pandas.DataFrame.plot \
pandas.DataFrame.sparse.density \
pandas.DataFrame.sparse.to_coo \
pandas.DataFrame.to_gbq \
pandas.DataFrame.style \
pandas.DataFrame.__dataframe__
Expand Down
2 changes: 2 additions & 0 deletions ci/deps/actions-310-numpydev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ dependencies:
- python-dateutil
- pytz
- pip

- pip:
- "cython"
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
- "--pre"
- "numpy"
- "scipy"
- "tzdata>=2022.1"
4 changes: 3 additions & 1 deletion ci/deps/actions-310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ dependencies:
- scipy>=1.7.1
- sqlalchemy>=1.4.16
- tabulate>=0.8.9
- tzdata>=2022a
- xarray>=0.21.0
- xlrd>=2.0.1
- xlsxwriter>=1.4.3
- zstandard>=0.15.2

- pip:
- tzdata>=2022.1
4 changes: 3 additions & 1 deletion ci/deps/actions-311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ dependencies:
- scipy>=1.7.1
- sqlalchemy>=1.4.16
- tabulate>=0.8.9
- tzdata>=2022a
- xarray>=0.21.0
- xlrd>=2.0.1
- xlsxwriter>=1.4.3
- zstandard>=0.15.2

- pip:
- tzdata>=2022.1
3 changes: 3 additions & 0 deletions ci/deps/actions-38-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ dependencies:
- pandas-gbq>=0.15.0
- pyyaml
- py

- pip:
- tzdata>=2022.1
2 changes: 1 addition & 1 deletion ci/deps/actions-38-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ dependencies:
- scipy=1.7.1
- sqlalchemy=1.4.16
- tabulate=0.8.9
- tzdata=2022a
- xarray=0.21.0
- xlrd=2.0.1
- xlsxwriter=1.4.3
- zstandard=0.15.2

- pip:
- pyqt5==5.15.1
- tzdata==2022.1
3 changes: 3 additions & 0 deletions ci/deps/actions-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ dependencies:
- xlrd>=2.0.1
- xlsxwriter>=1.4.3
- zstandard>=0.15.2

- pip:
- tzdata>=2022.1
4 changes: 3 additions & 1 deletion ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ dependencies:
- scipy>=1.7.1
- sqlalchemy>=1.4.16
- tabulate>=0.8.9
- tzdata>=2022a
- xarray>=0.21.0
- xlrd>=2.0.1
- xlsxwriter>=1.4.3
- zstandard>=0.15.2

- pip:
- tzdata>=2022.1
3 changes: 3 additions & 0 deletions ci/deps/actions-pypy-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dependencies:
- numpy
- python-dateutil
- pytz

- pip:
- tzdata>=2022.1
2 changes: 1 addition & 1 deletion ci/test_wheels_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pd.test(extra_args=['-m not clipboard and not single_cpu and not slow and not ne
pd.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db'])

python --version
pip install pytz six numpy python-dateutil
pip install pytz six numpy python-dateutil tzdata>=2022.1
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
pip install --find-links=pandas/dist --no-index pandas
python -c "%test_command%"
Binary file modified doc/source/_static/reshaping_pivot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,20 @@
reldir = os.path.relpath(dirname, source_path)
for fname in fnames:
if os.path.splitext(fname)[-1] in (".rst", ".ipynb"):
fname = os.path.relpath(os.path.join(dirname, fname), source_path)
rel_fname = os.path.relpath(os.path.join(dirname, fname), source_path)

if fname == "index.rst" and os.path.abspath(dirname) == source_path:
if rel_fname == "index.rst" and os.path.abspath(dirname) == source_path:
continue
if pattern == "-api" and reldir.startswith("reference"):
exclude_patterns.append(fname)
exclude_patterns.append(rel_fname)
elif (
pattern == "whatsnew"
and not reldir.startswith("reference")
and reldir != "whatsnew"
):
exclude_patterns.append(fname)
elif single_doc and fname != pattern:
exclude_patterns.append(fname)
exclude_patterns.append(rel_fname)
elif single_doc and rel_fname != pattern:
exclude_patterns.append(rel_fname)

with open(os.path.join(source_path, "index.rst.template")) as f:
t = jinja2.Template(f.read())
Expand Down
14 changes: 8 additions & 6 deletions doc/source/development/community.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ contributing to pandas. The slack is a private space, specifically meant for
people who are hesitant to bring up their questions or ideas on a large public
mailing list or GitHub.

If this sounds like the right place for you, you are welcome to join! Email us
at `slack@pandas.pydata.org <mailto://slack@pandas.pydata.org>`_ and let us
know that you read and agree to our `Code of Conduct <https://pandas.pydata.org/community/coc.html>`_
😉 to get an invite. And please remember that slack is not meant to replace the
mailing list or issue tracker - all important announcements and conversations
should still happen there.
If this sounds like the right place for you, you are welcome to join using
`this link <https://join.slack.com/t/pandas-dev-community/shared_invite/zt-1e2qgy1r6-PLCN8UOLEUAYoLdAsaJilw>`_!
Please remember to follow our `Code of Conduct <https://pandas.pydata.org/community/coc.html>`_,
and be aware that our admins are monitoring for irrelevant messages and will remove folks who use
our
slack for spam, advertisements and messages not related to the pandas contributing community. And
please remember that slack is not meant to replace the mailing list or issue tracker - all important
announcements and conversations should still happen there.
3 changes: 2 additions & 1 deletion doc/source/development/contributing_codebase.rst
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,8 @@ install pandas) by typing::
your installation is probably fine and you can start contributing!

Often it is worth running only a subset of tests first around your changes before running the
entire suite.
entire suite (tip: you can use the [pandas-coverage app](https://pandas-coverage.herokuapp.com/)
to find out which tests hit the lines of code you've modified, and then run only those).

The easiest way to do this is with::

Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ Data sets do not only contain numerical data. pandas provides a wide range of fu
Coming from...
--------------

Are you familiar with other software for manipulating tablular data? Learn
Are you familiar with other software for manipulating tabular data? Learn
the pandas-equivalent operations compared to software you already know:

.. panels::
Expand Down

0 comments on commit 42368e0

Please sign in to comment.