Skip to content

BUG: Interchange Column.size() is still called as a property in some places #50554

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

Closed
3 tasks done
AlenkaF opened this issue Jan 4, 2023 · 0 comments · Fixed by #50565
Closed
3 tasks done

BUG: Interchange Column.size() is still called as a property in some places #50554

AlenkaF opened this issue Jan 4, 2023 · 0 comments · Fixed by #50565
Labels
Bug Interchange Dataframe Interchange Protocol

Comments

@AlenkaF
Copy link

AlenkaF commented Jan 4, 2023

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

df = pd.DataFrame({"y": [1, 2, 0]})
dfX = df.__dataframe__()
colX = dfX.get_column(0)

colX.size
#<bound method PandasColumn.size of <pandas.core.interchange.column.PandasColumn object at 0x1586da310>>

colX.size()
#3

Issue Description

There has been a change in the Dataframe Interchange Protocol specs and Column.size() is now defined as a method, not as a property. There has already been a PR dealing with this change #48426

Unfortunately there still seem to be some places where Column.size() is referred to as a property, for example in from_dataframe:

data = buffer_to_ndarray(data_buff, data_dtype, col.offset, col.size)

Expected Behavior

Column.size() should always be called as a method, not as a property.

Installed Versions

commit : 87cfe4e
python : 3.9.14.final.0
python-bits : 64
OS : Darwin
OS-release : 21.6.0
Version : Darwin Kernel Version 21.6.0: Thu Sep 29 20:13:46 PDT 2022; root:xnu-8020.240.7~1/RELEASE_ARM64_T8101
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8

pandas : 1.5.0
numpy : 1.22.3
pytz : 2022.1
dateutil : 2.8.2
setuptools : 65.5.1
pip : 22.3.1
Cython : 0.29.28
pytest : 7.1.3
hypothesis : 6.39.4
sphinx : 4.3.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.3
IPython : 8.1.1
pandas_datareader: None
bs4 : 4.10.0
bottleneck : None
brotli : None
fastparquet : None
fsspec : 2022.02.0
gcsfs : 2022.02.0
matplotlib : 3.6.2
numba : 0.56.4
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 11.0.0.dev117+geeca8a4e3.d20221122
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : 0.9.0
xarray : 2022.11.0
xlrd : None
xlwt : None
zstandard : None
tzdata : None

@AlenkaF AlenkaF added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 4, 2023
@jorisvandenbossche jorisvandenbossche added Interchange Dataframe Interchange Protocol and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Interchange Dataframe Interchange Protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants