Skip to content

[Python] Typecheck expects pandas to be installed #23349

Closed

Description

@asfimport

See nightly build failure: https://circleci.com/gh/ursa-labs/crossbow/4285?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

The following patch fixes it:

diff --git a/python/pyarrow/table.pxi b/python/pyarrow/table.pxi
index b65dac4cb..e0a82fd76 100644
--- a/python/pyarrow/table.pxi
+++ b/python/pyarrow/table.pxi
@@ -17,6 +17,7 @@

 import warnings

+
 cdef class ChunkedArray(_PandasConvertible):
     """
     Array backed via one or more memory chunks.
@@ -1579,7 +1580,7 @@ def record_batch(data, names=None, schema=None, metadata=None):
     if isinstance(data, (list, tuple)):
         return RecordBatch.from_arrays(data, names=names, schema=schema,
                                        metadata=metadata)
-    elif isinstance(data, _pandas_api.pd.DataFrame):
+    elif _pandas_api.is_data_frame(data):
         return RecordBatch.from_pandas(data, schema=schema)
     else:
         return TypeError("Expected pandas DataFrame or python dictionary")

Reporter: Krisztian Szucs / @kszucs
Assignee: Joris Van den Bossche / @jorisvandenbossche

PRs and other links:

Note: This issue was originally created as ARROW-7039. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Oct 31, 2019

    @asfimport
    Author
  2. asfimport commented on Oct 31, 2019

    @asfimport
    Author

    Joris Van den Bossche / @jorisvandenbossche:
    Ah, this was probably never covered by the tests before .. Thanks for the note, will do a quick PR!

  3. asfimport commented on Nov 1, 2019

    @asfimport
    Author

    Krisztian Szucs / @kszucs:
    Issue resolved by pull request 5764
    #5764

  4. added this to the 0.16.0 milestone on Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions