Skip to content

Commit 467073a

Browse files
committed
Merge branch 'master' into reduction_dtypes_II
2 parents 1ed3e2d + 49d96b4 commit 467073a

File tree

90 files changed

+2674
-1926
lines changed

Some content is hidden

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

90 files changed

+2674
-1926
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,28 +105,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
105105
pandas.errors.UnsupportedFunctionCall \
106106
pandas.test \
107107
pandas.NaT \
108-
pandas.SparseDtype \
109-
pandas.DatetimeTZDtype.unit \
110-
pandas.DatetimeTZDtype.tz \
111-
pandas.PeriodDtype.freq \
112-
pandas.IntervalDtype.subtype \
113-
pandas_dtype \
114-
pandas.api.types.is_bool \
115-
pandas.api.types.is_complex \
116-
pandas.api.types.is_float \
117-
pandas.api.types.is_integer \
118-
pandas.api.types.pandas_dtype \
119108
pandas.read_clipboard \
120109
pandas.ExcelFile \
121110
pandas.ExcelFile.parse \
122-
pandas.DataFrame.to_html \
123111
pandas.io.formats.style.Styler.to_html \
124-
pandas.HDFStore.put \
125-
pandas.HDFStore.append \
126-
pandas.HDFStore.get \
127-
pandas.HDFStore.select \
128-
pandas.HDFStore.info \
129-
pandas.HDFStore.keys \
130112
pandas.HDFStore.groups \
131113
pandas.HDFStore.walk \
132114
pandas.read_feather \

ci/deps/actions-310.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies:
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
1717
- pytest-asyncio>=0.17.0
18+
- pytest-localserver>=0.7.1
1819
- boto3
1920

2021
# required dependencies

ci/deps/actions-311-downstream_compat.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies:
1616
- pytest-cov
1717
- pytest-xdist>=2.2.0
1818
- pytest-asyncio>=0.17.0
19+
- pytest-localserver>=0.7.1
1920
- boto3
2021

2122
# required dependencies

ci/deps/actions-311.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies:
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
1717
- pytest-asyncio>=0.17.0
18+
- pytest-localserver>=0.7.1
1819
- boto3
1920

2021
# required dependencies

ci/deps/actions-39-minimum_versions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dependencies:
1717
- pytest-cov
1818
- pytest-xdist>=2.2.0
1919
- pytest-asyncio>=0.17.0
20+
- pytest-localserver>=0.7.1
2021
- boto3
2122

2223
# required dependencies

ci/deps/actions-39.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies:
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
1717
- pytest-asyncio>=0.17.0
18+
- pytest-localserver>=0.7.1
1819
- boto3
1920

2021
# required dependencies

ci/deps/circle-310-arm64.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies:
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
1717
- pytest-asyncio>=0.17.0
18+
- pytest-localserver>=0.7.1
1819
- boto3
1920

2021
# required dependencies

doc/source/development/contributing_codebase.rst

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -612,23 +612,17 @@ deleted when the context block is exited.
612612
Testing involving network connectivity
613613
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
614614

615-
It is highly discouraged to add a test that connects to the internet due to flakiness of network connections and
616-
lack of ownership of the server that is being connected to. If network connectivity is absolutely required, use the
617-
``tm.network`` decorator.
615+
A unit test should not access a public data set over the internet due to flakiness of network connections and
616+
lack of ownership of the server that is being connected to. To mock this interaction, use the ``httpserver`` fixture from the
617+
`pytest-localserver plugin. <https://github.com/pytest-dev/pytest-localserver>`_ with synthetic data.
618618

619619
.. code-block:: python
620620
621-
@tm.network # noqa
622-
def test_network():
623-
result = package.call_to_internet()
624-
625-
If the test requires data from a specific website, specify ``check_before_test=True`` and the site in the decorator.
626-
627-
.. code-block:: python
628-
629-
@tm.network("https://www.somespecificsite.com", check_before_test=True)
630-
def test_network():
631-
result = pd.read_html("https://www.somespecificsite.com")
621+
@pytest.mark.network
622+
@pytest.mark.single_cpu
623+
def test_network(httpserver):
624+
httpserver.serve_content(content="content")
625+
result = pd.read_html(httpserver.url)
632626
633627
Example
634628
^^^^^^^

doc/source/whatsnew/v2.0.3.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ including other versions of pandas.
1313

1414
Fixed regressions
1515
~~~~~~~~~~~~~~~~~
16+
- Bug in :meth:`Timestamp.weekday`` was returning incorrect results before ``'0000-02-29'`` (:issue:`53738`)
1617
- Fixed performance regression in merging on datetime-like columns (:issue:`53231`)
18+
- Fixed regression when :meth:`DataFrame.to_string` creates extra space for string dtypes (:issue:`52690`)
1719
- For external ExtensionArray implementations, restored the default use of ``_values_for_factorize`` for hashing arrays (:issue:`53475`)
1820
-
1921

doc/source/whatsnew/v2.1.0.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ Deprecations
333333
- Deprecated allowing ``downcast`` keyword other than ``None``, ``False``, "infer", or a dict with these as values in :meth:`Series.fillna`, :meth:`DataFrame.fillna` (:issue:`40988`)
334334
- Deprecated allowing arbitrary ``fill_value`` in :class:`SparseDtype`, in a future version the ``fill_value`` will need to be compatible with the ``dtype.subtype``, either a scalar that can be held by that subtype or ``NaN`` for integer or bool subtypes (:issue:`23124`)
335335
- Deprecated behavior of :func:`assert_series_equal` and :func:`assert_frame_equal` considering NA-like values (e.g. ``NaN`` vs ``None`` as equivalent) (:issue:`52081`)
336+
- Deprecated bytes input to :func:`read_excel`. To read a file path, use a string or path-like object. (:issue:`53767`)
336337
- Deprecated constructing :class:`SparseArray` from scalar data, pass a sequence instead (:issue:`53039`)
337338
- Deprecated falling back to filling when ``value`` is not specified in :meth:`DataFrame.replace` and :meth:`Series.replace` with non-dict-like ``to_replace`` (:issue:`33302`)
338339
- Deprecated literal json input to :func:`read_json`. Wrap literal json string input in ``io.StringIO`` instead. (:issue:`53409`)
@@ -343,6 +344,7 @@ Deprecations
343344
- Deprecated the "method" and "limit" keywords on :meth:`Series.fillna`, :meth:`DataFrame.fillna`, :meth:`SeriesGroupBy.fillna`, :meth:`DataFrameGroupBy.fillna`, and :meth:`Resampler.fillna`, use ``obj.bfill()`` or ``obj.ffill()`` instead (:issue:`53394`)
344345
- Deprecated the ``method`` and ``limit`` keywords in :meth:`DataFrame.replace` and :meth:`Series.replace` (:issue:`33302`)
345346
- Deprecated values "pad", "ffill", "bfill", "backfill" for :meth:`Series.interpolate` and :meth:`DataFrame.interpolate`, use ``obj.ffill()`` or ``obj.bfill()`` instead (:issue:`53581`)
347+
-
346348

347349
.. ---------------------------------------------------------------------------
348350
.. _whatsnew_210.performance:
@@ -402,12 +404,14 @@ Datetimelike
402404
- :meth:`DatetimeIndex.map` with ``na_action="ignore"`` now works as expected. (:issue:`51644`)
403405
- Bug in :class:`DateOffset` which had inconsistent behavior when multiplying a :class:`DateOffset` object by a constant (:issue:`47953`)
404406
- Bug in :func:`date_range` when ``freq`` was a :class:`DateOffset` with ``nanoseconds`` (:issue:`46877`)
407+
- Bug in :meth:`DataFrame.to_sql` raising ``ValueError`` for pyarrow-backed date like dtypes (:issue:`53854`)
405408
- Bug in :meth:`Timestamp.date`, :meth:`Timestamp.isocalendar`, :meth:`Timestamp.timetuple`, and :meth:`Timestamp.toordinal` were returning incorrect results for inputs outside those supported by the Python standard library's datetime module (:issue:`53668`)
406409
- Bug in :meth:`Timestamp.round` with values close to the implementation bounds returning incorrect results instead of raising ``OutOfBoundsDatetime`` (:issue:`51494`)
407410
- Bug in :meth:`arrays.DatetimeArray.map` and :meth:`DatetimeIndex.map`, where the supplied callable operated array-wise instead of element-wise (:issue:`51977`)
408411
- Bug in constructing a :class:`Series` or :class:`DataFrame` from a datetime or timedelta scalar always inferring nanosecond resolution instead of inferring from the input (:issue:`52212`)
409412
- Bug in parsing datetime strings with weekday but no day e.g. "2023 Sept Thu" incorrectly raising ``AttributeError`` instead of ``ValueError`` (:issue:`52659`)
410413

414+
411415
Timedelta
412416
^^^^^^^^^
413417
- :meth:`TimedeltaIndex.map` with ``na_action="ignore"`` now works as expected (:issue:`51644`)
@@ -531,6 +535,7 @@ Reshaping
531535
- Bug in :func:`crosstab` when ``dropna=False`` would not keep ``np.nan`` in the result (:issue:`10772`)
532536
- Bug in :func:`merge_asof` raising ``KeyError`` for extension dtypes (:issue:`52904`)
533537
- Bug in :func:`merge_asof` raising ``ValueError`` for data backed by read-only ndarrays (:issue:`53513`)
538+
- Bug in :func:`merge_asof` with ``left_index=True`` or ``right_index=True`` with mismatched index dtypes giving incorrect results in some cases instead of raising ``MergeError`` (:issue:`53870`)
534539
- Bug in :meth:`DataFrame.agg` and :meth:`Series.agg` on non-unique columns would return incorrect type when dist-like argument passed in (:issue:`51099`)
535540
- Bug in :meth:`DataFrame.combine_first` ignoring other's columns if ``other`` is empty (:issue:`53792`)
536541
- Bug in :meth:`DataFrame.idxmin` and :meth:`DataFrame.idxmax`, where the axis dtype would be lost for empty frames (:issue:`53265`)
@@ -539,6 +544,7 @@ Reshaping
539544
- Bug in :meth:`DataFrame.stack` sorting columns lexicographically (:issue:`53786`)
540545
- Bug in :meth:`DataFrame.transpose` inferring dtype for object column (:issue:`51546`)
541546
- Bug in :meth:`Series.combine_first` converting ``int64`` dtype to ``float64`` and losing precision on very large integers (:issue:`51764`)
547+
-
542548

543549
Sparse
544550
^^^^^^
@@ -573,11 +579,12 @@ Other
573579
- Bug in :func:`assert_almost_equal` now throwing assertion error for two unequal sets (:issue:`51727`)
574580
- Bug in :func:`assert_frame_equal` checks category dtypes even when asked not to check index type (:issue:`52126`)
575581
- Bug in :meth:`DataFrame.reindex` with a ``fill_value`` that should be inferred with a :class:`ExtensionDtype` incorrectly inferring ``object`` dtype (:issue:`52586`)
582+
- Bug in :meth:`DataFrame.shift` and :meth:`Series.shift` when passing both "freq" and "fill_value" silently ignoring "fill_value" instead of raising ``ValueError`` (:issue:`53832`)
583+
- Bug in :meth:`DataFrame.shift` with ``axis=1`` on a :class:`DataFrame` with a single :class:`ExtensionDtype` column giving incorrect results (:issue:`53832`)
576584
- Bug in :meth:`Series.align`, :meth:`DataFrame.align`, :meth:`Series.reindex`, :meth:`DataFrame.reindex`, :meth:`Series.interpolate`, :meth:`DataFrame.interpolate`, incorrectly failing to raise with method="asfreq" (:issue:`53620`)
577585
- Bug in :meth:`Series.map` when giving a callable to an empty series, the returned series had ``object`` dtype. It now keeps the original dtype (:issue:`52384`)
578586
- Bug in :meth:`Series.memory_usage` when ``deep=True`` throw an error with Series of objects and the returned value is incorrect, as it does not take into account GC corrections (:issue:`51858`)
579587
- Fixed incorrect ``__name__`` attribute of ``pandas._libs.json`` (:issue:`52898`)
580-
-
581588

582589
.. ***DO NOT USE THIS SECTION***
583590

0 commit comments

Comments
 (0)