Skip to content

Commit 8cadb78

Browse files
authored
Merge branch 'main' into issue-37210-to-sql-truncate
2 parents ca10c55 + fb6c4e3 commit 8cadb78

Some content is hidden

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

42 files changed

+637
-200
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
7373
-i "pandas.Period.freq GL08" \
7474
-i "pandas.Period.ordinal GL08" \
75-
-i "pandas.RangeIndex.from_range PR01,SA01" \
7675
-i "pandas.Timedelta.max PR02" \
7776
-i "pandas.Timedelta.min PR02" \
7877
-i "pandas.Timedelta.resolution PR02" \

doc/source/reference/window.rst

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Rolling window functions
3535
Rolling.skew
3636
Rolling.kurt
3737
Rolling.apply
38+
Rolling.pipe
3839
Rolling.aggregate
3940
Rolling.quantile
4041
Rolling.sem
@@ -76,6 +77,7 @@ Expanding window functions
7677
Expanding.skew
7778
Expanding.kurt
7879
Expanding.apply
80+
Expanding.pipe
7981
Expanding.aggregate
8082
Expanding.quantile
8183
Expanding.sem

doc/source/user_guide/io.rst

+11-7
Original file line numberDiff line numberDiff line change
@@ -2340,6 +2340,7 @@ Read a URL with no options:
23402340
.. code-block:: ipython
23412341
23422342
In [320]: url = "https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list"
2343+
23432344
In [321]: pd.read_html(url)
23442345
Out[321]:
23452346
[ Bank NameBank CityCity StateSt ... Acquiring InstitutionAI Closing DateClosing FundFund
@@ -2366,6 +2367,7 @@ Read a URL while passing headers alongside the HTTP request:
23662367
.. code-block:: ipython
23672368
23682369
In [322]: url = 'https://www.sump.org/notes/request/' # HTTP request reflector
2370+
23692371
In [323]: pd.read_html(url)
23702372
Out[323]:
23712373
[ 0 1
@@ -2378,14 +2380,16 @@ Read a URL while passing headers alongside the HTTP request:
23782380
1 Host: www.sump.org
23792381
2 User-Agent: Python-urllib/3.8
23802382
3 Connection: close]
2383+
23812384
In [324]: headers = {
2382-
In [325]: 'User-Agent':'Mozilla Firefox v14.0',
2383-
In [326]: 'Accept':'application/json',
2384-
In [327]: 'Connection':'keep-alive',
2385-
In [328]: 'Auth':'Bearer 2*/f3+fe68df*4'
2386-
In [329]: }
2387-
In [340]: pd.read_html(url, storage_options=headers)
2388-
Out[340]:
2385+
.....: 'User-Agent':'Mozilla Firefox v14.0',
2386+
.....: 'Accept':'application/json',
2387+
.....: 'Connection':'keep-alive',
2388+
.....: 'Auth':'Bearer 2*/f3+fe68df*4'
2389+
.....: }
2390+
2391+
In [325]: pd.read_html(url, storage_options=headers)
2392+
Out[325]:
23892393
[ 0 1
23902394
0 Remote Socket: 51.15.105.256:51760
23912395
1 Protocol Version: HTTP/1.1

doc/source/whatsnew/v2.3.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Other enhancements
3535
- The semantics for the ``copy`` keyword in ``__array__`` methods (i.e. called
3636
when using ``np.array()`` or ``np.asarray()`` on pandas objects) has been
3737
updated to work correctly with NumPy >= 2 (:issue:`57739`)
38+
- The :meth:`~Series.cumsum`, :meth:`~Series.cummin`, and :meth:`~Series.cummax` reductions are now implemented for ``StringDtype`` columns when backed by PyArrow (:issue:`60633`)
3839
- The :meth:`~Series.sum` reduction is now implemented for ``StringDtype`` columns (:issue:`59853`)
39-
-
4040

4141
.. ---------------------------------------------------------------------------
4242
.. _whatsnew_230.notable_bug_fixes:

doc/source/whatsnew/v3.0.0.rst

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Other enhancements
3030
^^^^^^^^^^^^^^^^^^
3131
- :class:`pandas.api.typing.FrozenList` is available for typing the outputs of :attr:`MultiIndex.names`, :attr:`MultiIndex.codes` and :attr:`MultiIndex.levels` (:issue:`58237`)
3232
- :class:`pandas.api.typing.SASReader` is available for typing the output of :func:`read_sas` (:issue:`55689`)
33+
- :class:`pandas.api.typing.NoDefault` is available for typing ``no_default``
3334
- :func:`DataFrame.to_excel` now raises an ``UserWarning`` when the character count in a cell exceeds Excel's limitation of 32767 characters (:issue:`56954`)
3435
- :func:`pandas.merge` now validates the ``how`` parameter input (merge type) (:issue:`59435`)
3536
- :func:`read_spss` now supports kwargs to be passed to pyreadstat (:issue:`56356`)
@@ -44,13 +45,15 @@ Other enhancements
4445
- Users can globally disable any ``PerformanceWarning`` by setting the option ``mode.performance_warnings`` to ``False`` (:issue:`56920`)
4546
- :meth:`Styler.format_index_names` can now be used to format the index and column names (:issue:`48936` and :issue:`47489`)
4647
- :class:`.errors.DtypeWarning` improved to include column names when mixed data types are detected (:issue:`58174`)
48+
- :class:`Rolling` and :class:`Expanding` now support ``pipe`` method (:issue:`57076`)
4749
- :class:`Series` now supports the Arrow PyCapsule Interface for export (:issue:`59518`)
4850
- :func:`DataFrame.to_excel` argument ``merge_cells`` now accepts a value of ``"columns"`` to only merge :class:`MultiIndex` column header header cells (:issue:`35384`)
4951
- :meth:`DataFrame.corrwith` now accepts ``min_periods`` as optional arguments, as in :meth:`DataFrame.corr` and :meth:`Series.corr` (:issue:`9490`)
5052
- :meth:`DataFrame.cummin`, :meth:`DataFrame.cummax`, :meth:`DataFrame.cumprod` and :meth:`DataFrame.cumsum` methods now have a ``numeric_only`` parameter (:issue:`53072`)
5153
- :meth:`DataFrame.ewm` now allows ``adjust=False`` when ``times`` is provided (:issue:`54328`)
5254
- :meth:`DataFrame.fillna` and :meth:`Series.fillna` can now accept ``value=None``; for non-object dtype the corresponding NA value will be used (:issue:`57723`)
5355
- :meth:`DataFrame.pivot_table` and :func:`pivot_table` now allow the passing of keyword arguments to ``aggfunc`` through ``**kwargs`` (:issue:`57884`)
56+
- :meth:`DataFrame.to_json` now encodes ``Decimal`` as strings instead of floats (:issue:`60698`)
5457
- :meth:`Series.cummin` and :meth:`Series.cummax` now supports :class:`CategoricalDtype` (:issue:`52335`)
5558
- :meth:`Series.plot` now correctly handle the ``ylabel`` parameter for pie charts, allowing for explicit control over the y-axis label (:issue:`58239`)
5659
- :meth:`DataFrame.plot.scatter` argument ``c`` now accepts a column of strings, where rows with the same string are colored identically (:issue:`16827` and :issue:`16485`)
@@ -687,6 +690,7 @@ MultiIndex
687690
- :meth:`DataFrame.melt` would not accept multiple names in ``var_name`` when the columns were a :class:`MultiIndex` (:issue:`58033`)
688691
- :meth:`MultiIndex.insert` would not insert NA value correctly at unified location of index -1 (:issue:`59003`)
689692
- :func:`MultiIndex.get_level_values` accessing a :class:`DatetimeIndex` does not carry the frequency attribute along (:issue:`58327`, :issue:`57949`)
693+
- Bug in :class:`DataFrame` arithmetic operations in case of unaligned MultiIndex columns (:issue:`60498`)
690694
-
691695

692696
I/O

pandas/_libs/include/pandas/vendored/ujson/lib/ultrajson.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ typedef void (*JSPFN_ITERBEGIN)(JSOBJ obj, JSONTypeContext *tc);
170170
typedef int (*JSPFN_ITERNEXT)(JSOBJ obj, JSONTypeContext *tc);
171171
typedef void (*JSPFN_ITEREND)(JSOBJ obj, JSONTypeContext *tc);
172172
typedef JSOBJ (*JSPFN_ITERGETVALUE)(JSOBJ obj, JSONTypeContext *tc);
173-
typedef char *(*JSPFN_ITERGETNAME)(JSOBJ obj, JSONTypeContext *tc,
174-
size_t *outLen);
173+
typedef const char *(*JSPFN_ITERGETNAME)(JSOBJ obj, JSONTypeContext *tc,
174+
size_t *outLen);
175175
typedef void *(*JSPFN_MALLOC)(size_t size);
176176
typedef void (*JSPFN_FREE)(void *pptr);
177177
typedef void *(*JSPFN_REALLOC)(void *base, size_t size);

pandas/_libs/src/parser/tokenizer.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ int parser_init(parser_t *self) {
148148
self->warn_msg = NULL;
149149

150150
// token stream
151-
self->stream = malloc(STREAM_INIT_SIZE * sizeof(char));
151+
self->stream = malloc(STREAM_INIT_SIZE);
152152
if (self->stream == NULL) {
153153
parser_cleanup(self);
154154
return PARSER_OUT_OF_MEMORY;
@@ -221,9 +221,8 @@ static int make_stream_space(parser_t *self, size_t nbytes) {
221221
char *orig_ptr = (void *)self->stream;
222222
TRACE(("\n\nmake_stream_space: nbytes = %zu. grow_buffer(self->stream...)\n",
223223
nbytes))
224-
self->stream =
225-
(char *)grow_buffer((void *)self->stream, self->stream_len,
226-
&self->stream_cap, nbytes * 2, sizeof(char), &status);
224+
self->stream = (char *)grow_buffer((void *)self->stream, self->stream_len,
225+
&self->stream_cap, nbytes * 2, 1, &status);
227226
TRACE(("make_stream_space: self->stream=%p, self->stream_len = %zu, "
228227
"self->stream_cap=%zu, status=%zu\n",
229228
self->stream, self->stream_len, self->stream_cap, status))

pandas/_libs/src/vendored/ujson/lib/ultrajsonenc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ Perhaps implement recursion detection */
920920
void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name,
921921
size_t cbName) {
922922
const char *value;
923-
char *objName;
923+
const char *objName;
924924
int count;
925925
JSOBJ iterObj;
926926
size_t szlen;

0 commit comments

Comments
 (0)