From 04974c5afeed044eb9fba399e65d341c7e14fdef Mon Sep 17 00:00:00 2001 From: Jim Pivarski Date: Thu, 26 Oct 2023 08:47:13 -0500 Subject: [PATCH] fix: protect RecordForm against len(fields) != len(contents) (#2776) 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. --- src/awkward/forms/recordform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/awkward/forms/recordform.py b/src/awkward/forms/recordform.py index ec6cec59cb..26f0f1bc98 100644 --- a/src/awkward/forms/recordform.py +++ b/src/awkward/forms/recordform.py @@ -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