Skip to content

BUG: round on object columns no longer raises a TypeError #61399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 405 commits into
base: main
Choose a base branch
from

Conversation

KevsterAmp
Copy link
Contributor

lithomas1 and others added 30 commits April 10, 2024 12:42
…ice_locs_negative_step Pyarrow test) (pandas-dev#58269)

Backport PR pandas-dev#58268: CI/TST: Unxfail test_slice_locs_negative_step Pyarrow test

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
….21) (pandas-dev#58295)

Backport PR pandas-dev#58293: CI: Pin docutils to < 0.21

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…pandas-dev#58408)

Backport PR pandas-dev#58389: CI: Fix npdev failures

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…n string array consistently) (pandas-dev#58597)

Backport PR pandas-dev#58590: BUG: Use large_string in string array consistently

Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
Fix typo in "Returning a view versus a copy" section
…t_api_read_sql_duplicate_columns for pyarrow=16 and sqlite) (pandas-dev#58660)

Backport PR pandas-dev#58658: CI/TST: Don't xfail test_api_read_sql_duplicate_columns for pyarrow=16 and sqlite

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…on't xfail postgresql / don't xfail for pyarrow=16)) (pandas-dev#58709)

Backport PR pandas-dev#58693: TST: Fix CI failures (don't xfail postgresql / don't xfail for pyarrow=16)

Co-authored-by: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com>
…y_index_types due to new 2024.5 release) (pandas-dev#58720)

Backport PR pandas-dev#58719: CI: xfail test_to_xarray_index_types due to new 2024.5 release

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…te locators for DatetimeIndex plotting) (pandas-dev#59002)

Backport PR pandas-dev#58992: PERF: cache plotting date locators for DatetimeIndex plotting

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…t_to_xarray_index_types ) (pandas-dev#59015)

Backport PR pandas-dev#59013: CI: remove xfail in test_to_xarray_index_types

Co-authored-by: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com>
…s for SciPy 1.14.0) (pandas-dev#59104)

Backport PR pandas-dev#59094: BUG: Fix sparse doctests for SciPy 1.14.0

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
…s to work for any module that raises an exception) (pandas-dev#59158)

Backport PR pandas-dev#59114: BUG: Allow show_versions to work for any module that raises an exception

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…g in matplotlib test) (pandas-dev#59175)

Backport PR pandas-dev#59168: TST: Address UserWarning in matplotlib test

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…gcs for pyarrow=17) (pandas-dev#59308)

Backport PR pandas-dev#59306: CI: xfail test_to_read_gcs for pyarrow=17

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…imedelta * DateOffset) (pandas-dev#59444)

Backport PR pandas-dev#59441: COMPAT: Fix numpy 2.1 timedelta * DateOffset

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…failures) (pandas-dev#59550)

Backport PR pandas-dev#59545: CI: Fix ci for numpy 2 failures

Co-authored-by: Patrick Hoefler <61934744+phofl@users.noreply.github.com>
…ests (pandas-dev#59570)

* Backport PR pandas-dev#59553: CI: Uninstall nomkl & 32 bit Interval tests

* Update pandas/tests/indexes/interval/test_interval_tree.py

* Update pandas/tests/indexes/interval/test_interval_tree.py

* Update pandas/tests/indexing/interval/test_interval_new.py

* Update pandas/tests/indexing/interval/test_interval_new.py
…2.2.3) (pandas-dev#59812)

Backport PR pandas-dev#59811: DOC: add whatsnew for v2.2.3

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
…motion_state usage) (pandas-dev#59821)

BUG: Remove np._get_promotion_state usage (pandas-dev#59818)

(cherry picked from commit 081dcde)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
…uilds) (pandas-dev#59828)

Backport PR pandas-dev#59813: CI: Debug failing ARM builds

Co-authored-by: Thomas Li <47963215+lithomas1@users.noreply.github.com>
…olve pandas-dev#2137) (pandas-dev#59535)

* remove core.computation.ops.Div resolves pandas-dev#21374 pandas-dev#58748

* need to preserve order

* updating tests

* (update whatsnew -- no whatsnew for 2.2.x and 2.3 yet)

* solve mypy issue

* fixing pytests

* better than cast

* adding specific test

(* Update pandas/tests/frame/test_query_eval.py // Not backported, fails on 2.2)



* Update pandas/tests/computation/test_eval.py



---------

Co-authored-by: Laurent Mutricy <laurent.mutricy@ekium.eu>
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Co-authored-by: Thomas Li <47963215+lithomas1@users.noreply.github.com>
* Backport PR pandas-dev#59065: ENH: Fix Python 3.13 test failures & enable CI

* Remove deprecated plot_date calls (pandas-dev#58484)

* Remove deprecated plot_date calls

These were deprecated in Matplotlib 3.9.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit c9bc480)

* Pick out fastparquet xfails for green CI

* pin pytz to fix test_arrays.py

* more workflow tweaks for pytz and Python 3.13

* fix typing and tune tests for copy on write

* remove WASM stuff

* more arm skips

* go for green

---------

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
…otation) (pandas-dev#59837)

Backport PR pandas-dev#59836: BLD: Fix bad Cython annotation

Co-authored-by: Thomas Li <47963215+lithomas1@users.noreply.github.com>
…aded nightly wheels) (pandas-dev#59835)

* Bump pypa/cibuildwheel from 2.19.1 to 2.19.2 (pandas-dev#59208)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.19.1 to 2.19.2.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](pypa/cibuildwheel@v2.19.1...v2.19.2)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit ad09dc6)

* Upload 3.13 & free-threaded nightly wheels (pandas-dev#59136)

* Upload free-threaded nightly wheels on Linux and macOS

* Consolidate jobs into one

* Install build dependencies in before-build and pass --no-build-isolation

* Fix {project} placeholder in cibuildwheel config

* Correctly quote echo CIBW_BUILD_FRONTEND command

* Run echo -e

* Add {package} to before-build

* Include cibw script in sdist & add matrix value for build frontend

* Change manifest and gitattributes

* Change gitattributes

* Install verioneer in before-build

* Add cibw_before_test to install nightly NumPy

* Expand before-test to musl

* Better comments plus always run before-build/before-test on 3.13

* Add --no-build-isolation in 3.13 as well

* Install nightly numpy before windows tests

* Address feedback; add todo for NumPy nightly and move default outside matrix

* Set build_frontend to 'build' in pyodide build

---------

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
(cherry picked from commit 7c0ee27)

* CI: Update to cibuildwheel 2.20.0 (pandas-dev#59401)

cibuildwheel 2.20.0 uses the ABI stable Python 3.13.0rc1 and build Python 3.13 wheels by default, which allows removing the `CIBW_PRERELEASE_PYTHONS` flag.

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
(cherry picked from commit 70bb855)

* Update wheels.yml

* BLD/RLS: build wheels with released numpy/cython for Python 3.13 (pandas-dev#59819)

(cherry picked from commit 2237217)

* enable prerelease again

---------

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Ewout ter Hoeven <E.M.terHoeven@student.tudelft.nl>
Co-authored-by: Thomas Li <47963215+lithomas1@users.noreply.github.com>
rhshadrach and others added 12 commits February 16, 2025 09:39
…tables (pandas-dev#60916)

* ENH: Improved error message and raise new error for small-string NaN edge case in HDFStore.append (pandas-dev#60829)

* Add clearer error messages for datatype mismatch in HDFStore.append. Raise ValueError when nan_rep too large for pytable column. Add and modify applicable test code.

* Fix missed tests and correct mistake in error message.

* Remove excess comments. Reverse error type change to avoid api changes. Move nan_rep tests into separate function.

(cherry picked from commit 57340ec)

* TST(string dtype): Resolve xfails in pytables (pandas-dev#60795)

(cherry picked from commit 4511251)

* Adjust test

---------

Co-authored-by: Jake Thomas Trevallion <136272202+JakeTT404@users.noreply.github.com>
…il when reading with condition (pandas-dev#60967)

* ENH: Improved error message and raise new error for small-string NaN edge case in HDFStore.append (pandas-dev#60829)

* Add clearer error messages for datatype mismatch in HDFStore.append. Raise ValueError when nan_rep too large for pytable column. Add and modify applicable test code.

* Fix missed tests and correct mistake in error message.

* Remove excess comments. Reverse error type change to avoid api changes. Move nan_rep tests into separate function.

(cherry picked from commit 57340ec)

* TST(string dtype): Resolve xfails in pytables (pandas-dev#60795)

(cherry picked from commit 4511251)

* BUG(string dtype): Resolve pytables xfail when reading with condition (pandas-dev#60943)

(cherry picked from commit 0ec5f26)

---------

Co-authored-by: Jake Thomas Trevallion <136272202+JakeTT404@users.noreply.github.com>
…andas-dev#60968)

* ENH: Improved error message and raise new error for small-string NaN edge case in HDFStore.append (pandas-dev#60829)

* Add clearer error messages for datatype mismatch in HDFStore.append. Raise ValueError when nan_rep too large for pytable column. Add and modify applicable test code.

* Fix missed tests and correct mistake in error message.

* Remove excess comments. Reverse error type change to avoid api changes. Move nan_rep tests into separate function.

(cherry picked from commit 57340ec)

* TST(string dtype): Resolve xfails in pytables (pandas-dev#60795)

(cherry picked from commit 4511251)

* BUG(string dtype): Resolve pytables xfail when reading with condition (pandas-dev#60943)

(cherry picked from commit 0ec5f26)

* Backport PR pandas-dev#60940: ENH: Add dtype argument to str.decode

---------

Co-authored-by: Jake Thomas Trevallion <136272202+JakeTT404@users.noreply.github.com>
… Python-backed strings (pandas-dev#60984)

* ENH: Improved error message and raise new error for small-string NaN edge case in HDFStore.append (pandas-dev#60829)

* Add clearer error messages for datatype mismatch in HDFStore.append. Raise ValueError when nan_rep too large for pytable column. Add and modify applicable test code.

* Fix missed tests and correct mistake in error message.

* Remove excess comments. Reverse error type change to avoid api changes. Move nan_rep tests into separate function.

(cherry picked from commit 57340ec)

* TST(string dtype): Resolve xfails in pytables (pandas-dev#60795)

(cherry picked from commit 4511251)

* BUG(string dtype): Resolve pytables xfail when reading with condition (pandas-dev#60943)

(cherry picked from commit 0ec5f26)

* Backport PR pandas-dev#60940: ENH: Add dtype argument to str.decode

* Backport PR pandas-dev#60938: ENH(string dtype): Implement cumsum for Python-backed strings

---------

Co-authored-by: Jake Thomas Trevallion <136272202+JakeTT404@users.noreply.github.com>
… query string values to single quotes) (pandas-dev#61001)

Backport PR pandas-dev#61000: TST: Change sqlite test query string values to single quotes

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
…s_not_invalid for pyarrow nightly (pandas-dev#61044)

* Backport PR pandas-dev#61042: CI/TST: Fix xfail in test_columns_dtypes_not_invalid for pyarrow nightly

* remove xfail
…sionArray repr for NEP51) (pandas-dev#61107)

Backport PR pandas-dev#61085: DEPS: Update NumpyExtensionArray repr for NEP51

Co-authored-by: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com>
…duce_series_numeric supporting skew (pandas-dev#61102)

* Backport PR pandas-dev#61098: CI/TST: Address TestArrowArray::test_reduce_series_numeric supporting skew

* remove skew from check

* Remove kurt too

* Add skew to bool skip list

* Add boolean

* bool fails regardless of skipna
@KevsterAmp
Copy link
Contributor Author

pre-commit.ci is timing out and the 2 failed unit tests are canceled operations.

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good - can you add a note in the 2.3 whatsnew. I think we should backport this as it's a regression.

cc @mroeschke

@@ -72,3 +72,9 @@ def test_round_ea_boolean(self):
tm.assert_series_equal(result, expected)
result.iloc[0] = False
tm.assert_series_equal(ser, expected)

def test_round_dtype_object(self):
ser = Series([0.2], dtype="object")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a reference to the GitHub issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@rhshadrach rhshadrach added Bug Regression Functionality that used to work in a prior pandas version Numeric Operations Arithmetic, Comparison, and Logical operations labels May 19, 2025
@rhshadrach rhshadrach added this to the 2.3 milestone May 19, 2025
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
@KevsterAmp KevsterAmp requested a review from rhshadrach May 20, 2025 11:06
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mroeschke
Copy link
Member

@KevsterAmp could you target this PR to main? We have a process to backport this PR to the 2.3.x branch after it is merged to main

@KevsterAmp KevsterAmp changed the base branch from 2.3.x to main May 20, 2025 23:28
@KevsterAmp KevsterAmp requested a review from attack68 as a code owner May 20, 2025 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.