Skip to content

Commit

Permalink
fix: protect RecordForm against len(fields) != len(contents) (#2776)
Browse files Browse the repository at this point in the history
Noticed this while @ioanaif was debugging an issue in Uproot.

No time pressure; just thought I'd fix it while we see it.

If you approve, @agoose77, go ahead and merge it.
  • Loading branch information
jpivarski committed Oct 26, 2023
1 parent 26cfc12 commit 04974c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/awkward/forms/recordform.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def __init__(

self._fields = None if fields is None else list(fields)
self._contents = list(contents)
if fields is not None:
assert len(self._fields) == len(self._contents)
self._init(parameters=parameters, form_key=form_key)

@property
Expand Down

0 comments on commit 04974c5

Please sign in to comment.