Skip to content

Commit 9979f41

Browse files
committed
Merge remote-tracking branch 'upstream/master' into typ_c_parser
2 parents 95a0de0 + aee6b7a commit 9979f41

File tree

141 files changed

+1890
-1131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1890
-1131
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
shell: bash -l {0}
2424

2525
concurrency:
26-
group: ${{ github.ref }}-checks
27-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
26+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
27+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-checks
28+
cancel-in-progress: true
2829

2930
steps:
3031
- name: Checkout
@@ -102,7 +103,8 @@ jobs:
102103
runs-on: ubuntu-latest
103104

104105
concurrency:
105-
group: ${{ github.ref }}-web-docs
106+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
107+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-web-docs
106108
cancel-in-progress: true
107109

108110
steps:
@@ -160,11 +162,20 @@ jobs:
160162
data_manager:
161163
name: Test experimental data manager
162164
runs-on: ubuntu-latest
165+
services:
166+
moto:
167+
image: motoserver/moto
168+
env:
169+
AWS_ACCESS_KEY_ID: foobar_key
170+
AWS_SECRET_ACCESS_KEY: foobar_secret
171+
ports:
172+
- 5000:5000
163173
strategy:
164174
matrix:
165175
pattern: ["not slow and not network and not clipboard", "slow"]
166176
concurrency:
167-
group: ${{ github.ref }}-data_manager-${{ matrix.pattern }}
177+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
178+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-data_manager-${{ matrix.pattern }}
168179
cancel-in-progress: true
169180

170181
steps:

.github/workflows/database.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ jobs:
3131
fail-fast: false
3232

3333
concurrency:
34-
group: ${{ github.ref }}-${{ matrix.ENV_FILE }}
35-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
34+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
35+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.ENV_FILE }}
36+
cancel-in-progress: true
3637

3738
services:
3839
mysql:
@@ -62,6 +63,14 @@ jobs:
6263
ports:
6364
- 5432:5432
6465

66+
moto:
67+
image: motoserver/moto
68+
env:
69+
AWS_ACCESS_KEY_ID: foobar_key
70+
AWS_SECRET_ACCESS_KEY: foobar_secret
71+
ports:
72+
- 5000:5000
73+
6574
steps:
6675
- name: Checkout
6776
uses: actions/checkout@v2

.github/workflows/posix.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,17 @@ jobs:
4646
TEST_ARGS: ${{ matrix.settings[6] }}
4747
PYTEST_TARGET: pandas
4848
concurrency:
49-
group: ${{ github.ref }}-${{ matrix.settings[0] }}
50-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
49+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
50+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}
51+
cancel-in-progress: true
52+
services:
53+
moto:
54+
image: motoserver/moto
55+
env:
56+
AWS_ACCESS_KEY_ID: foobar_key
57+
AWS_SECRET_ACCESS_KEY: foobar_secret
58+
ports:
59+
- 5000:5000
5160

5261
steps:
5362
- name: Checkout

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ jobs:
1111
pre-commit:
1212
runs-on: ubuntu-latest
1313
concurrency:
14-
group: ${{ github.ref }}-pre-commit
15-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
14+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
15+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pre-commit
16+
cancel-in-progress: true
1617
steps:
1718
- uses: actions/checkout@v2
1819
- uses: actions/setup-python@v2

.github/workflows/python-dev.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ jobs:
3131
timeout-minutes: 80
3232

3333
concurrency:
34-
group: ${{ github.ref }}-${{ matrix.os }}-${{ matrix.pytest_target }}-dev
35-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
34+
#https://github.community/t/concurrecy-not-work-for-push/183068/7
35+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-${{ matrix.pytest_target }}-dev
36+
cancel-in-progress: true
3637

3738
steps:
3839
- uses: actions/checkout@v2

.github/workflows/sdist.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ jobs:
2525
matrix:
2626
python-version: ["3.8", "3.9", "3.10"]
2727
concurrency:
28-
group: ${{github.ref}}-${{matrix.python-version}}-sdist
29-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
28+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
29+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{matrix.python-version}}-sdist
30+
cancel-in-progress: true
3031

3132
steps:
3233
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- id: absolufy-imports
1010
files: ^pandas/
1111
- repo: https://github.com/python/black
12-
rev: 21.10b0
12+
rev: 21.11b1
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/codespell-project/codespell
@@ -55,11 +55,11 @@ repos:
5555
types: [text]
5656
args: [--append-config=flake8/cython-template.cfg]
5757
- repo: https://github.com/PyCQA/isort
58-
rev: 5.9.3
58+
rev: 5.10.1
5959
hooks:
6060
- id: isort
6161
- repo: https://github.com/asottile/pyupgrade
62-
rev: v2.29.0
62+
rev: v2.29.1
6363
hooks:
6464
- id: pyupgrade
6565
args: [--py38-plus]

asv_bench/benchmarks/frame_ctor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
)
2020
except ImportError:
2121
# For compatibility with older versions
22-
from pandas.core.datetools import * # noqa
22+
from pandas.core.datetools import (
23+
Hour,
24+
Nano,
25+
)
2326

2427

2528
class FromDicts:

ci/deps/actions-38-db-min.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ dependencies:
3838
- xlrd
3939
- xlsxwriter
4040
- xlwt
41-
- moto
42-
- flask
4341

4442
# sql
4543
- psycopg2=2.8.4

ci/deps/actions-38-db.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies:
1414
# pandas dependencies
1515
- aiobotocore<2.0.0
1616
- beautifulsoup4
17+
- boto3
1718
- botocore>=1.11
1819
- dask
1920
- fastparquet>=0.4.0
@@ -22,8 +23,6 @@ dependencies:
2223
- geopandas
2324
- html5lib
2425
- matplotlib
25-
- moto>=1.3.14
26-
- flask
2726
- nomkl
2827
- numexpr
2928
- numpy=1.18

ci/deps/actions-38-locale.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ dependencies:
1414

1515
# pandas dependencies
1616
- beautifulsoup4
17-
- flask
1817
- html5lib
1918
- ipython
2019
- jinja2
2120
- jedi
2221
- lxml
2322
- matplotlib<3.3.0
24-
- moto
2523
- nomkl
2624
- numexpr
2725
- numpy<1.20 # GH#39541 compat with pyarrow<3
@@ -34,7 +32,6 @@ dependencies:
3432
- xlrd
3533
- xlsxwriter
3634
- xlwt
37-
- moto
3835
- pyarrow=1.0.1
3936
- pip
4037
- pip:

ci/deps/actions-38-slow.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies:
1313

1414
# pandas dependencies
1515
- beautifulsoup4
16+
- boto3
1617
- fsspec>=0.7.4
1718
- html5lib
1819
- lxml
@@ -27,12 +28,9 @@ dependencies:
2728
- python-dateutil
2829
- pytz
2930
- s3fs>=0.4.0
30-
- moto>=1.3.14
3131
- scipy
3232
- sqlalchemy
3333
- xlrd
3434
- xlsxwriter
3535
- xlwt
36-
- moto
37-
- flask
3836
- numba

ci/deps/actions-39-slow.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ dependencies:
1515
# pandas dependencies
1616
- beautifulsoup4
1717
- bottleneck
18+
- boto3
1819
- fsspec>=0.8.0
1920
- gcsfs
2021
- html5lib
2122
- jinja2
2223
- lxml
2324
- matplotlib
24-
- moto>=1.3.14
25-
- flask
2625
- numba
2726
- numexpr
2827
- numpy

ci/deps/actions-39.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ dependencies:
1414
# pandas dependencies
1515
- beautifulsoup4
1616
- bottleneck
17+
- boto3
1718
- fsspec>=0.8.0
1819
- gcsfs
1920
- html5lib
2021
- jinja2
2122
- lxml
2223
- matplotlib
23-
- moto>=1.3.14
24-
- flask
2524
- numba
2625
- numexpr
2726
- numpy

ci/deps/azure-windows-38.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ dependencies:
1616
- blosc
1717
- bottleneck
1818
- fastparquet>=0.4.0
19-
- flask
2019
- fsspec>=0.8.0
2120
- matplotlib=3.3.2
22-
- moto>=1.3.14
2321
- numba
2422
- numexpr
2523
- numpy=1.18

ci/deps/azure-windows-39.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ dependencies:
2121
- jinja2
2222
- lxml
2323
- matplotlib
24-
- moto>=1.3.14
25-
- flask
2624
- numba
2725
- numexpr
2826
- numpy

doc/source/ecosystem.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ Data cleaning and validation
3535

3636
Pyjanitor provides a clean API for cleaning data, using method chaining.
3737

38-
`Engarde <https://engarde.readthedocs.io/en/latest/>`__
38+
`Pandera <https://pandera.readthedocs.io/en/stable/>`__
3939
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4040

41-
Engarde is a lightweight library used to explicitly state assumptions about your datasets
42-
and check that they're *actually* true.
41+
Pandera provides a flexible and expressive API for performing data validation on dataframes
42+
to make data processing pipelines more readable and robust.
43+
Dataframes contain information that pandera explicitly validates at runtime. This is useful in
44+
production-critical data pipelines or reproducible research settings.
4345

4446
`pandas-path <https://github.com/drivendataorg/pandas-path/>`__
4547
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/user_guide/io.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ squeeze : boolean, default ``False``
161161
the data.
162162
prefix : str, default ``None``
163163
Prefix to add to column numbers when no header, e.g. 'X' for X0, X1, ...
164+
165+
.. deprecated:: 1.4.0
166+
Use a list comprehension on the DataFrame's columns after calling ``read_csv``.
167+
168+
.. ipython:: python
169+
170+
data = "col1,col2,col3\na,b,1"
171+
172+
df = pd.read_csv(StringIO(data))
173+
df.columns = [f"pre_{col}" for col in df.columns]
174+
df
175+
164176
mangle_dupe_cols : boolean, default ``True``
165177
Duplicate columns will be specified as 'X', 'X.1'...'X.N', rather than 'X'...'X'.
166178
Passing in ``False`` will cause data to be overwritten if there are duplicate

doc/source/whatsnew/v0.5.0.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ New features
2828
- :ref:`Added <indexing.set_index>` convenience ``set_index`` function for creating a DataFrame index from its existing columns
2929
- :ref:`Implemented <groupby.multiindex>` ``groupby`` hierarchical index level name (:issue:`223`)
3030
- :ref:`Added <io.store_in_csv>` support for different delimiters in ``DataFrame.to_csv`` (:issue:`244`)
31-
- TODO: DOCS ABOUT TAKE METHODS
3231

3332
Performance enhancements
3433
~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/whatsnew/v1.4.0.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ Other enhancements
217217
- Added "Juneteenth National Independence Day" to
218218
``USFederalHolidayCalendar``. See also `Other API changes`_.
219219
- :meth:`.Rolling.var`, :meth:`.Expanding.var`, :meth:`.Rolling.std`, :meth:`.Expanding.std` now support `Numba <http://numba.pydata.org/>`_ execution with the ``engine`` keyword (:issue:`44461`)
220+
- :meth:`Series.info` has been added, for compatibility with :meth:`DataFrame.info` (:issue:`5167`)
220221

221222

222223
.. ---------------------------------------------------------------------------
@@ -516,8 +517,10 @@ Other Deprecations
516517
- Deprecated casting behavior when setting timezone-aware value(s) into a timezone-aware :class:`Series` or :class:`DataFrame` column when the timezones do not match. Previously this cast to object dtype. In a future version, the values being inserted will be converted to the series or column's existing timezone (:issue:`37605`)
517518
- Deprecated casting behavior when passing an item with mismatched-timezone to :meth:`DatetimeIndex.insert`, :meth:`DatetimeIndex.putmask`, :meth:`DatetimeIndex.where` :meth:`DatetimeIndex.fillna`, :meth:`Series.mask`, :meth:`Series.where`, :meth:`Series.fillna`, :meth:`Series.shift`, :meth:`Series.replace`, :meth:`Series.reindex` (and :class:`DataFrame` column analogues). In the past this has cast to object dtype. In a future version, these will cast the passed item to the index or series's timezone (:issue:`37605`)
518519
- Deprecated the 'errors' keyword argument in :meth:`Series.where`, :meth:`DataFrame.where`, :meth:`Series.mask`, and meth:`DataFrame.mask`; in a future version the argument will be removed (:issue:`44294`)
520+
- Deprecated the ``prefix`` keyword argument in :func:`read_csv` and :func:`read_table`, in a future version the argument will be removed (:issue:`43396`)
519521
- Deprecated :meth:`PeriodIndex.astype` to ``datetime64[ns]`` or ``DatetimeTZDtype``, use ``obj.to_timestamp(how).tz_localize(dtype.tz)`` instead (:issue:`44398`)
520522
- Deprecated passing non boolean argument to sort in :func:`concat` (:issue:`41518`)
523+
- Deprecated passing arguments as positional for :func:`read_fwf` other than ``filepath_or_buffer`` (:issue:`41485`):
521524
- Deprecated passing ``skipna=None`` for :meth:`DataFrame.mad` and :meth:`Series.mad`, pass ``skipna=True`` instead (:issue:`44580`)
522525
- Deprecated :meth:`DateOffset.apply`, use ``offset + other`` instead (:issue:`44522`)
523526
- A deprecation warning is now shown for :meth:`DataFrame.to_latex` indicating the arguments signature may change and emulate more the arguments to :meth:`.Styler.to_latex` in future versions (:issue:`44411`)
@@ -621,12 +624,14 @@ Timezones
621624

622625
Numeric
623626
^^^^^^^
627+
- Bug in floor-dividing a list or tuple of integers by a :class:`Series` incorrectly raising (:issue:`44674`)
624628
- Bug in :meth:`DataFrame.rank` raising ``ValueError`` with ``object`` columns and ``method="first"`` (:issue:`41931`)
625629
- Bug in :meth:`DataFrame.rank` treating missing values and extreme values as equal (for example ``np.nan`` and ``np.inf``), causing incorrect results when ``na_option="bottom"`` or ``na_option="top`` used (:issue:`41931`)
626630
- Bug in ``numexpr`` engine still being used when the option ``compute.use_numexpr`` is set to ``False`` (:issue:`32556`)
627631
- Bug in :class:`DataFrame` arithmetic ops with a subclass whose :meth:`_constructor` attribute is a callable other than the subclass itself (:issue:`43201`)
628632
- Bug in arithmetic operations involving :class:`RangeIndex` where the result would have the incorrect ``name`` (:issue:`43962`)
629633
- Bug in arithmetic operations involving :class:`Series` where the result could have the incorrect ``name`` when the operands having matching NA or matching tuple names (:issue:`44459`)
634+
- Bug in division with ``IntegerDtype`` or ``BooleanDtype`` array and NA scalar incorrectly raising (:issue:`44685`)
630635
-
631636

632637
Conversion
@@ -677,6 +682,7 @@ Indexing
677682
- Bug in :meth:`Series.reset_index` not ignoring ``name`` argument when ``drop`` and ``inplace`` are set to ``True`` (:issue:`44575`)
678683
- Bug in :meth:`DataFrame.loc.__setitem__` and :meth:`DataFrame.iloc.__setitem__` with mixed dtypes sometimes failing to operate in-place (:issue:`44345`)
679684
- Bug in :meth:`DataFrame.loc.__getitem__` incorrectly raising ``KeyError`` when selecting a single column with a boolean key (:issue:`44322`).
685+
- Bug in setting :meth:`DataFrame.iloc` with a single ``ExtensionDtype`` column and setting 2D values e.g. ``df.iloc[:] = df.values`` incorrectly raising (:issue:`44514`)
680686
- Bug in indexing on columns with ``loc`` or ``iloc`` using a slice with a negative step with ``ExtensionDtype`` columns incorrectly raising (:issue:`44551`)
681687
- Bug in :meth:`IntervalIndex.get_indexer_non_unique` returning boolean mask instead of array of integers for a non unique and non monotonic index (:issue:`44084`)
682688
- Bug in :meth:`IntervalIndex.get_indexer_non_unique` not handling targets of ``dtype`` 'object' with NaNs correctly (:issue:`44482`)
@@ -796,7 +802,9 @@ ExtensionArray
796802
- NumPy ufuncs ``np.abs``, ``np.positive``, ``np.negative`` now correctly preserve dtype when called on ExtensionArrays that implement ``__abs__, __pos__, __neg__``, respectively. In particular this is fixed for :class:`TimedeltaArray` (:issue:`43899`)
797803
- NumPy ufuncs ``np.minimum.reduce`` and ``np.maximum.reduce`` now work correctly instead of raising ``NotImplementedError`` on :class:`Series` with ``IntegerDtype`` or ``FloatDtype`` (:issue:`43923`)
798804
- Avoid raising ``PerformanceWarning`` about fragmented DataFrame when using many columns with an extension dtype (:issue:`44098`)
805+
- Bug in :class:`IntegerArray` and :class:`FloatingArray` construction incorrectly coercing mismatched NA values (e.g. ``np.timedelta64("NaT")``) to numeric NA (:issue:`44514`)
799806
- Bug in :meth:`BooleanArray.__eq__` and :meth:`BooleanArray.__ne__` raising ``TypeError`` on comparison with an incompatible type (like a string). This caused :meth:`DataFrame.replace` to sometimes raise a ``TypeError`` if a nullable boolean column was included (:issue:`44499`)
807+
- Bug in :meth:`Series.where` with ``ExtensionDtype`` when ``other`` is a NA scalar incompatible with the series dtype (e.g. ``NaT`` with a numeric dtype) incorrectly casting to a compatible NA value (:issue:`44697`)
800808
-
801809

802810
Styler
@@ -822,7 +830,7 @@ Other
822830
- Bug in :meth:`FloatingArray.equals` failing to consider two arrays equal if they contain ``np.nan`` values (:issue:`44382`)
823831
- Bug in :meth:`DataFrame.shift` with ``axis=1`` and ``ExtensionDtype`` columns incorrectly raising when an incompatible ``fill_value`` is passed (:issue:`44564`)
824832
- Bug in :meth:`DataFrame.diff` when passing a NumPy integer object instead of an ``int`` object (:issue:`44572`)
825-
-
833+
- Bug in :meth:`Series.replace` raising ``ValueError`` when using ``regex=True`` with a :class:`Series` containing ``np.nan`` values (:issue:`43344`)
826834

827835
.. ***DO NOT USE THIS SECTION***
828836

0 commit comments

Comments
 (0)