Bug 15781

Summary: recipes python3-pandas not getting built properly for arm
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Prasad Mulay <prasad.mulay>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: Undecided CC: meta.mr.watcher, meta.watcher, prasad.mulay, randy.macleod
Version: 5.0.10   
Target Milestone: 0.0.0   
Hardware: Other   
OS: arm   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Prasad Mulay 2025-03-05 05:08:59 UTC

    
Comment 1 Prasad Mulay 2025-03-05 05:14:46 UTC
https://github.com/pandas-dev/pandas/issues/55305
this is reported on pandas repo. looking at the comments looks to be bug from build system. I have tried the solution specified there. but still problem is persisting.
 I am using custom IMX6 board. 

Copy paste of details from pandas issue.
Reproducible Example
import pandas as pd

# Create a list of data
data = [["Alice", 25], ["Bob", 30], ["Carol", 35]]

# Create a Pandas DataFrame from the list of data
df = pd.DataFrame(data, columns=["Name", "Age"])

# Print the DataFrame
print(df)
Issue Description
The simplest test on a dataframe object is failing on an embedded 32bit device with ARMv7 CPU. No matter how the dataframe is created, from an array or read from a csv file using read_csv, access on the object fails the same:

File "pandas/_libs/internals.pyx", line 711, in pandas._libs.internals.BlockManager._rebuild_blknos_and_blklocs
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long long'

Unfortunately, on that platform I cannot compile a newer version of pandas, so I cannot verify if the issue is present in the latest version or main branch.

Expected Behavior
The expected output is:
Name Age
0 Alice 25
1 Bob 30
2 Carol 35

but running the script is giving:
File "/home/root/test.py", line 10, in
print(df)
File "/usr/lib/python3.10/site-packages/pandas/core/frame.py", line 1011, in repr
return self.to_string(**repr_params)
File "/usr/lib/python3.10/site-packages/pandas/core/frame.py", line 1192, in to_string
return fmt.DataFrameRenderer(formatter).to_string(
File "/usr/lib/python3.10/site-packages/pandas/io/formats/format.py", line 1128, in to_string
string = string_formatter.to_string()
File "/usr/lib/python3.10/site-packages/pandas/io/formats/string.py", line 25, in to_string
text = self._get_string_representation()
File "/usr/lib/python3.10/site-packages/pandas/io/formats/string.py", line 40, in _get_string_representation
strcols = self._get_strcols()
File "/usr/lib/python3.10/site-packages/pandas/io/formats/string.py", line 31, in _get_strcols
strcols = self.fmt.get_strcols()
File "/usr/lib/python3.10/site-packages/pandas/io/formats/format.py", line 611, in get_strcols
strcols = self._get_strcols_without_index()
File "/usr/lib/python3.10/site-packages/pandas/io/formats/format.py", line 864, in _get_strcols_without_index
str_columns = self._get_formatted_column_labels(self.tr_frame)
File "/usr/lib/python3.10/site-packages/pandas/io/formats/format.py", line 943, in _get_formatted_column_labels
dtypes = self.frame.dtypes
File "/usr/lib/python3.10/site-packages/pandas/core/generic.py", line 5746, in dtypes
data = self._mgr.get_dtypes()
File "/usr/lib/python3.10/site-packages/pandas/core/internals/managers.py", line 228, in get_dtypes
return dtypes.take(self.blknos)
File "/usr/lib/python3.10/site-packages/pandas/core/internals/managers.py", line 168, in blknos
self._rebuild_blknos_and_blklocs()
File "pandas/_libs/internals.pyx", line 711, in pandas._libs.internals.BlockManager._rebuild_blknos_and_blklocs
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long long'
Comment 2 Prasad Mulay 2025-03-05 05:35:48 UTC
Below is rspose from my board.
root@imx6dldau:~# python
Python 3.12.6 (main, Sep  6 2024, 19:03:47) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> # Create a list of data
>>> data = [["Alice", 25], ["Bob", 30], ["Carol", 35]]
>>> # Create a Pandas DataFrame from the list of data
>>> df = pd.DataFrame(data, columns=["Name", "Age"])
>>> # Print the DataFrame
>>> print(df)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.12/site-packages/pandas/core/frame.py", line 1094, in __repr__
    return self.to_string(**repr_params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/core/frame.py", line 1271, in to_string
    return fmt.DataFrameRenderer(formatter).to_string(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/io/formats/format.py", line 1134, in to_string
    string = string_formatter.to_string()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/io/formats/string.py", line 30, in to_string
    text = self._get_string_representation()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/io/formats/string.py", line 45, in _get_string_representation
    strcols = self._get_strcols()
              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/io/formats/string.py", line 36, in _get_strcols
    strcols = self.fmt.get_strcols()
              ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/io/formats/format.py", line 615, in get_strcols
    strcols = self._get_strcols_without_index()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/io/formats/format.py", line 870, in _get_strcols_without_index
    str_columns = self._get_formatted_column_labels(self.tr_frame)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/io/formats/format.py", line 949, in _get_formatted_column_labels
    dtypes = self.frame.dtypes
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/core/generic.py", line 6158, in dtypes
    data = self._mgr.get_dtypes()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/core/internals/managers.py", line 278, in get_dtypes
    return dtypes.take(self.blknos)
                       ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pandas/core/internals/managers.py", line 179, in blknos
    self._rebuild_blknos_and_blklocs()
  File "pandas/_libs/internals.pyx", line 755, in pandas._libs.internals.BlockManager._rebuild_blknos_and_blklocs
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long long'
>>>
Comment 3 Randy MacLeod 2025-03-06 15:43:55 UTC
pandas is in meta-openembedded which doesn't use the bug tracker.
Please send a fix or an report to the meta-oe list.

https://layers.openembedded.org/layerindex/recipe/72554/