Skip to content
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

BUG: Interchange Column.size is a property, not a method #48392

Closed
3 tasks done
honno opened this issue Sep 5, 2022 · 0 comments · Fixed by #48426
Closed
3 tasks done

BUG: Interchange Column.size is a property, not a method #48392

honno opened this issue Sep 5, 2022 · 0 comments · Fixed by #48426
Labels
API Design Interchange Dataframe Interchange Protocol
Milestone

Comments

@honno
Copy link
Contributor

honno commented Sep 5, 2022

  • 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

>>> df = pd.DataFrame({"foo": [42]})
>>> interchange_df = df.__dataframe__()
>>> interchange_col = interchange_df.get_column_by_name("foo")
>>> interchange_col.size()
TypeError: 'int' object is not callable

Issue Description

Per data-apis/dataframe-api#74, the interchange protocol now requires Column.size to be a method, not a property.

So the property decorator should be removed here, and usage of size-as-a-property in interchanging other libraries should be updated to size() (as well as in the test suite).

Couldn't see reference to this in the spec update PRs #47886 and #47887. Thanks to @maartenbreddels for catching this!

cc @mroeschke

Expected Behavior

>>> interchange_col.size()
1

Installed Versions

INSTALLED VERSIONS
------------------
commit           : 5a2b5afa0fa17fc5356625243315621e87e7f3af
python           : 3.8.12.final.0
python-bits      : 64
OS               : Linux
OS-release       : 5.15.0-47-generic
Version          : #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : None
LANG             : en_GB.UTF-8
LOCALE           : en_GB.UTF-8

pandas           : 1.5.0.dev0+1223.g5a2b5afa0f
numpy            : 1.22.4
pytz             : 2022.1
dateutil         : 2.8.2
setuptools       : 62.6.0
pip              : 22.1.2
Cython           : None
pytest           : 7.2.0.dev227+gf43ddd8a
hypothesis       : 6.53.0
sphinx           : 4.2.0
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : None
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : 3.1.2
IPython          : 8.4.0
pandas_datareader: None
bs4              : 4.11.1
bottleneck       : None
brotli           : None
fastparquet      : None
fsspec           : 2022.5.0
gcsfs            : 2022.5.0
matplotlib       : 3.5.2
numba            : 0.55.2
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : 8.0.0
pyreadstat       : None
pyxlsb           : None
s3fs             : 2022.5.0
scipy            : 1.8.1
snappy           : None
sqlalchemy       : None
tables           : None
tabulate         : 0.8.10
xarray           : 2022.6.0
xlrd             : None
xlwt             : None
zstandard        : None
@honno honno added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 5, 2022
@lithomas1 lithomas1 added API Design Interchange Dataframe Interchange Protocol and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 6, 2022
@lithomas1 lithomas1 added this to the 1.5 milestone Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Interchange Dataframe Interchange Protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants