Skip to content

Conversation

@kbolashev
Copy link
Member

@kbolashev kbolashev commented Jan 25, 2026

Should fix the broken test cases in https://github.com/DagsHub/client/blob/7c4169f229f460d2e8e1226f1e00581038d51708/tests/data_engine/test_datasource.py

Pandas 3 changed the types of values that get returned from df.dtypes, and the current check that we had is failing.
Instead switch to calling pandas.api.types.is_string_dtype

The actual functionality change is only at the bottom, everything else is import reorganization

@kbolashev kbolashev self-assigned this Jan 25, 2026
@kbolashev kbolashev added the bug Something isn't working label Jan 25, 2026
@dagshub
Copy link

dagshub bot commented Jan 25, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where uploading metadata from a pandas DataFrame fails with pandas version 3.x due to changes in how DataFrame dtypes are represented. The main fix updates the dtype checking logic to use pandas API methods instead of direct string comparison.

Changes:

  • Updated dtype checking to use pandas.api.types.is_string_dtype() instead of comparing dtype to "object" string
  • Reorganized imports to alphabetical order

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kbolashev kbolashev changed the title Bug: uploading metadata from a dataframe fails if pandas>3 Bug: uploading metadata from a dataframe fails if pandas>=3 Jan 25, 2026
@kbolashev kbolashev merged commit bdc1429 into main Jan 25, 2026
8 checks passed
@kbolashev kbolashev deleted the bug/pandas3-string-handling branch January 25, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants