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

fix: nbytes property of ak.Record #3352

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

pfackeldey
Copy link
Collaborator

This was uncovered by #3348 . (This bug is 3 years old, I suppose .nbytes was never accessed in that time on a ak.Record 😅)

Before:

>>> ak.Record({"foo": [1,2,3]}).nbytes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../awkward/highlevel.py", line 2200, in __getattr__
    return super().__getattribute__(where)
  File ".../awkward/highlevel.py", line 2012, in nbytes
    return self._layout.nbytes
AttributeError: 'Record' object has no attribute 'nbytes'

Now:

>>> ak.Record({"foo": [1,2,3]}).nbytes
>>> 24

@pfackeldey pfackeldey requested a review from jpivarski December 18, 2024 19:01
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

Good catch!

@pfackeldey pfackeldey merged commit 287347e into main Dec 18, 2024
39 checks passed
@pfackeldey pfackeldey deleted the pfackeldey/fix_highlevel_Record_properties branch December 18, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants