Skip to content

Fix one_key() not finding a key for CONTROL sources with a selection - #648

Merged
philsmt merged 1 commit into
masterfrom
fix/sourcedata-one-key-selection
Aug 6, 2025
Merged

Fix one_key() not finding a key for CONTROL sources with a selection#648
philsmt merged 1 commit into
masterfrom
fix/sourcedata-one-key-selection

Conversation

@philsmt

@philsmt philsmt commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

SourceData.one_key(index_group=None) may be called with '' for index_group in the case of CONTROL sources internally, which is meant to be supported throughout the stack. This fails however in the case of a key selection, as this enters a different branch not handling it properly. I suspect this fell through given the lack of test for it specifically.

Oddly enough I found this bug through exdf-tools reductions, where one would have assumed it should've come up sooner 🤷

@philsmt
philsmt requested a review from takluyver August 5, 2025 07:55
Comment thread extra_data/sourcedata.py
"""
if self.sel_keys is not None:
if index_group is None:
if index_group is None or self.is_control:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

One could also change this to if not index_group, but this seemed more explicit to me.

@takluyver

Copy link
Copy Markdown
Member

LGTM

@philsmt

philsmt commented Aug 6, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for review!

@philsmt
philsmt merged commit 487ad5d into master Aug 6, 2025
10 checks passed
@takluyver takluyver added the bug Something isn't working label Dec 2, 2025
@takluyver takluyver added this to the 1.23 milestone Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants