Skip to content

Commit 816e0fb

Browse files
committed
Make the python writers have the same behavior as the C++ writers
If no collections are passed then let the C++ decide instead of passing all collections (which is what the C++ writers do). In practice, this only allows to write empty frames from python, currently not possible as collections will evaluate to false and all the collections from `frame.getAvailableCollections` will be passed.
1 parent 1a678f5 commit 816e0fb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/podio/base_writer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def write_frame(self, frame, category, collections=None):
5353
write. If None, all collections are written
5454
"""
5555
# pylint: disable=protected-access
56-
self._writer.writeFrame(
57-
frame._frame, category, collections or frame.getAvailableCollections()
58-
)
56+
args = [frame._frame, category]
57+
if collections is not None:
58+
args.append(collections)
59+
self._writer.writeFrame(*args)

0 commit comments

Comments
 (0)