Skip to content

Commit 24ecfe2

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 0f4130d + 56aca32 commit 24ecfe2

File tree

94 files changed

+2107
-1908
lines changed

Some content is hidden

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

94 files changed

+2107
-1908
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ repos:
5050
- flake8==4.0.1
5151
- flake8-comprehensions==3.7.0
5252
- flake8-bugbear==21.3.2
53-
- pandas-dev-flaker==0.2.0
53+
- pandas-dev-flaker==0.4.0
5454
- repo: https://github.com/PyCQA/isort
5555
rev: 5.10.1
5656
hooks:

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pr:
1818
variables:
1919
PYTEST_WORKERS: auto
2020
PYTEST_TARGET: pandas
21+
PATTERN: "not slow and not high_memory and not db and not network"
22+
PANDAS_CI: 1
2123

2224
jobs:
2325
# Mac and Linux use the same template

ci/azure/windows.yml

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,22 @@ parameters:
44

55
jobs:
66
- job: ${{ parameters.name }}
7+
timeoutInMinutes: 90
78
pool:
89
vmImage: ${{ parameters.vmImage }}
910
strategy:
1011
matrix:
11-
py38_np18_1:
12-
ENV_FILE: ci/deps/azure-windows-38.yaml
12+
py38:
13+
ENV_FILE: ci/deps/actions-38.yaml
1314
CONDA_PY: "38"
14-
PATTERN: "not slow"
15-
PYTEST_WORKERS: 2 # GH-42236
16-
PYTEST_TARGET: "pandas/tests/[a-h]*"
1715

18-
py38_np18_2:
19-
ENV_FILE: ci/deps/azure-windows-38.yaml
20-
CONDA_PY: "38"
21-
PATTERN: "not slow"
22-
PYTEST_WORKERS: 2 # GH-42236
23-
PYTEST_TARGET: "pandas/tests/[i-z]*"
24-
25-
py39_1:
26-
ENV_FILE: ci/deps/azure-windows-39.yaml
27-
CONDA_PY: "39"
28-
PATTERN: "not slow and not high_memory"
29-
PYTEST_WORKERS: 2 # GH-42236
30-
PYTEST_TARGET: "pandas/tests/[a-h]*"
31-
32-
py39_2:
33-
ENV_FILE: ci/deps/azure-windows-39.yaml
16+
py39:
17+
ENV_FILE: ci/deps/actions-39.yaml
3418
CONDA_PY: "39"
35-
PATTERN: "not slow and not high_memory"
36-
PYTEST_WORKERS: 2 # GH-42236
37-
PYTEST_TARGET: "pandas/tests/[i-z]*"
38-
39-
py310_1:
40-
ENV_FILE: ci/deps/azure-windows-310.yaml
41-
CONDA_PY: "310"
42-
PATTERN: "not slow and not high_memory"
43-
PYTEST_WORKERS: 2 # GH-42236
44-
PYTEST_TARGET: "pandas/tests/[a-h]*"
4519

46-
py310_2:
47-
ENV_FILE: ci/deps/azure-windows-310.yaml
20+
py310:
21+
ENV_FILE: ci/deps/actions-310.yaml
4822
CONDA_PY: "310"
49-
PATTERN: "not slow and not high_memory"
50-
PYTEST_WORKERS: 2 # GH-42236
51-
PYTEST_TARGET: "pandas/tests/[i-z]*"
5223

5324
steps:
5425
- powershell: |
@@ -59,7 +30,7 @@ jobs:
5930
displayName: 'Update conda'
6031

6132
- bash: |
62-
conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
33+
conda env create -q --file ci\\deps\\actions-$(CONDA_PY).yaml
6334
displayName: 'Create anaconda environment'
6435
- bash: |
6536
source activate pandas-dev

ci/deps/azure-windows-310.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

ci/deps/azure-windows-38.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.

ci/deps/azure-windows-39.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@
446446
"pandas-gbq": ("https://pandas-gbq.readthedocs.io/en/latest/", None),
447447
"py": ("https://pylib.readthedocs.io/en/latest/", None),
448448
"python": ("https://docs.python.org/3/", None),
449-
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
449+
"scipy": ("https://docs.scipy.org/doc/scipy-1.7.1/reference/", None),
450450
"statsmodels": ("https://www.statsmodels.org/devel/", None),
451451
"pyarrow": ("https://arrow.apache.org/docs/", None),
452452
}

doc/source/reference/io.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Excel
5353

5454
.. autosummary::
5555
:toctree: api/
56-
:template: autosummary/class_without_autosummary.rst
5756

5857
ExcelWriter
5958

doc/source/whatsnew/v1.4.1.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Bug fixes
3434
- Stopped emitting unnecessary ``FutureWarning`` in :meth:`DataFrame.sort_values` with sparse columns (:issue:`45618`)
3535
- Fixed window aggregations in :meth:`DataFrame.rolling` and :meth:`Series.rolling` to skip over unused elements (:issue:`45647`)
3636
- Bug in :func:`api.types.is_bool_dtype` was raising an ``AttributeError`` when evaluating a categorical :class:`Series` (:issue:`45615`)
37+
- Fixed builtin highlighters in :class:`.Styler` to be responsive to ``NA`` with nullable dtypes (:issue:`45804`)
3738

3839
.. ---------------------------------------------------------------------------
3940

doc/source/whatsnew/v1.5.0.rst

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Other enhancements
3737
- :meth:`to_numeric` now preserves float64 arrays when downcasting would generate values not representable in float32 (:issue:`43693`)
3838
- :meth:`Series.reset_index` and :meth:`DataFrame.reset_index` now support the argument ``allow_duplicates`` (:issue:`44410`)
3939
- :meth:`.GroupBy.min` and :meth:`.GroupBy.max` now supports `Numba <https://numba.pydata.org/>`_ execution with the ``engine`` keyword (:issue:`45428`)
40+
- Implemented a ``bool``-dtype :class:`Index`, passing a bool-dtype arraylike to ``pd.Index`` will now retain ``bool`` dtype instead of casting to ``object`` (:issue:`45061`)
4041
-
4142

4243
.. ---------------------------------------------------------------------------
@@ -183,6 +184,43 @@ use ``series.loc[i:j]``.
183184

184185
Slicing on a :class:`DataFrame` will not be affected.
185186

187+
.. _whatsnew_150.deprecations.excel_writer_attributes:
188+
189+
:class:`ExcelWriter` attributes
190+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
191+
192+
All attributes of :class:`ExcelWriter` were previously documented as not
193+
public. However some third party Excel engines documented accessing
194+
``ExcelWriter.book`` or ``ExcelWriter.sheets``, and users were utilizing these
195+
and possibly other attributes. Previously these attributes were not safe to use;
196+
e.g. modifications to ``ExcelWriter.book`` would not update ``ExcelWriter.sheets``
197+
and conversely. In order to support this, pandas has made some attributes public
198+
and improved their implementations so that they may now be safely used. (:issue:`45572`)
199+
200+
The following attributes are now public and considered safe to access.
201+
202+
- ``book``
203+
- ``check_extension``
204+
- ``close``
205+
- ``date_format``
206+
- ``datetime_format``
207+
- ``engine``
208+
- ``if_sheet_exists``
209+
- ``sheets``
210+
- ``supported_extensions``
211+
212+
The following attributes have been deprecated. They now raise a ``FutureWarning``
213+
when accessed and will removed in a future version. Users should be aware
214+
that their usage is considered unsafe, and can lead to unexpected results.
215+
216+
- ``cur_sheet``
217+
- ``handles``
218+
- ``path``
219+
- ``save``
220+
- ``write_cells``
221+
222+
See the documentation of :class:`ExcelWriter` for further details.
223+
186224
.. _whatsnew_150.deprecations.other:
187225

188226
Other Deprecations
@@ -216,6 +254,7 @@ Bug fixes
216254

217255
Categorical
218256
^^^^^^^^^^^
257+
- Bug in :meth:`Categorical.view` not accepting integer dtypes (:issue:`25464`)
219258
- Bug in :meth:`CategoricalIndex.union` when the index's categories are integer-dtype and the index contains ``NaN`` values incorrectly raising instead of casting to ``float64`` (:issue:`45362`)
220259
-
221260

@@ -225,6 +264,7 @@ Datetimelike
225264
- Bug in :func:`to_datetime` with sequences of ``np.str_`` objects incorrectly raising (:issue:`32264`)
226265
- Bug in :class:`Timestamp` construction when passing datetime components as positional arguments and ``tzinfo`` as a keyword argument incorrectly raising (:issue:`31929`)
227266
- Bug in :meth:`Index.astype` when casting from object dtype to ``timedelta64[ns]`` dtype incorrectly casting ``np.datetime64("NaT")`` values to ``np.timedelta64("NaT")`` instead of raising (:issue:`45722`)
267+
- Bug in :meth:`SeriesGroupBy.value_counts` index when passing categorical column (:issue:`44324`)
228268
-
229269

230270
Timedelta
@@ -295,10 +335,11 @@ MultiIndex
295335
I/O
296336
^^^
297337
- Bug in :meth:`DataFrame.to_stata` where no error is raised if the :class:`DataFrame` contains ``-np.inf`` (:issue:`45350`)
338+
- Bug in :func:`read_excel` results in an infinite loop with certain ``skiprows`` callables (:issue:`45585`)
298339
- Bug in :meth:`DataFrame.info` where a new line at the end of the output is omitted when called on an empty :class:`DataFrame` (:issue:`45494`)
299340
- Bug in :func:`read_csv` not recognizing line break for ``on_bad_lines="warn"`` for ``engine="c"`` (:issue:`41710`)
300341
- Bug in :func:`read_parquet` when ``engine="pyarrow"`` which caused partial write to disk when column of unsupported datatype was passed (:issue:`44914`)
301-
-
342+
- Bug in :func:`DataFrame.to_excel` and :class:`ExcelWriter` would raise when writing an empty DataFrame to a ``.ods`` file (:issue:`45793`)
302343

303344
Period
304345
^^^^^^

environment.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ dependencies:
3232
# documentation
3333
- gitpython # obtain contributors from git for whatsnew
3434
- gitdb
35-
- sphinx
36-
- sphinx-panels
3735
- numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI
36+
- pandas-dev-flaker=0.4.0
3837
- pydata-sphinx-theme
38+
- pytest-cython
39+
- sphinx
40+
- sphinx-panels
3941
- types-python-dateutil
4042
- types-PyMySQL
4143
- types-pytz
@@ -78,7 +80,6 @@ dependencies:
7880
- ipywidgets
7981
- nbformat
8082
- notebook>=6.0.3
81-
- pip
8283

8384
# optional
8485
- blosc
@@ -120,6 +121,3 @@ dependencies:
120121
- pyreadstat # pandas.read_spss
121122
- tabulate>=0.8.3 # DataFrame.to_markdown
122123
- natsort # DataFrame.sort_values
123-
- pip:
124-
- pandas-dev-flaker==0.2.0
125-
- pytest-cython

pandas/_libs/index.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class ObjectEngine(IndexEngine): ...
4242
class DatetimeEngine(Int64Engine): ...
4343
class TimedeltaEngine(DatetimeEngine): ...
4444
class PeriodEngine(Int64Engine): ...
45+
class BoolEngine(UInt8Engine): ...
4546

4647
class BaseMultiIndexCodesEngine:
4748
levels: list[np.ndarray]

pandas/_libs/index.pyx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,13 @@ cdef class BaseMultiIndexCodesEngine:
802802
include "index_class_helper.pxi"
803803

804804

805+
cdef class BoolEngine(UInt8Engine):
806+
cdef _check_type(self, object val):
807+
if not util.is_bool_object(val):
808+
raise KeyError(val)
809+
return <uint8_t>val
810+
811+
805812
@cython.internal
806813
@cython.freelist(32)
807814
cdef class SharedEngine:

pandas/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ def _create_mi_with_dt64tz_level():
555555
"num_uint8": tm.makeNumericIndex(100, dtype="uint8"),
556556
"num_float64": tm.makeNumericIndex(100, dtype="float64"),
557557
"num_float32": tm.makeNumericIndex(100, dtype="float32"),
558-
"bool": tm.makeBoolIndex(10),
558+
"bool-object": tm.makeBoolIndex(10).astype(object),
559+
"bool-dtype": Index(np.random.randn(10) < 0),
559560
"categorical": tm.makeCategoricalIndex(100),
560561
"interval": tm.makeIntervalIndex(100),
561562
"empty": Index([]),
@@ -630,7 +631,7 @@ def index_flat_unique(request):
630631
key
631632
for key in indices_dict
632633
if not (
633-
key in ["int", "uint", "range", "empty", "repeats"]
634+
key in ["int", "uint", "range", "empty", "repeats", "bool-dtype"]
634635
or key.startswith("num_")
635636
)
636637
and not isinstance(indices_dict[key], MultiIndex)
@@ -1775,7 +1776,7 @@ def indexer_ial(request):
17751776

17761777

17771778
@pytest.fixture
1778-
def using_array_manager(request):
1779+
def using_array_manager():
17791780
"""
17801781
Fixture to check if the array manager is being used.
17811782
"""

0 commit comments

Comments
 (0)