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 missing header return in _populate_available_source_ids. #335

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/fusion_engine_client/parsers/mixed_log_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,8 @@ def get_available_source_ids(self) -> Set[int]:

def _populate_available_source_ids(self, num_messages_to_read: int = 10):
self.available_source_ids = set()
stored_return_header = self.return_header
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the issue here, is it a recursion thing or something? I'd definitely recommend a comment explaining this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nothing complicated, the lines in this function:

                    result = self.read_next()
                    header = result[0]

assume the header is returned.

self.return_header = True
# Loop over all message types and read N of each type.
for message_type in np.unique(self.index['type']):
message_type = MessageType(message_type, raise_on_unrecognized=False)
Expand All @@ -644,6 +646,7 @@ def _populate_available_source_ids(self, num_messages_to_read: int = 10):

self.clear_filters()

self.return_header = stored_return_header
self.rewind()

def __iter__(self):
Expand Down
Loading