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
DM-42054: Remove limit of 1 for getCommandsDuringEvent #83
Conversation
c693b56
to
5e1972e
Compare
if timeFormat not in ['pandas', 'astropy', 'python']: | ||
raise ValueError(f"format must be one of 'pandas', 'astropy' or 'python', not {timeFormat=}") | ||
|
||
commands = list(ensure_iterable(commands)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "listify" here? Can't the iterable be directly used in the for
loop below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate that too, but ensure_iterable
will just return an exhaustible generator if it got one of those, and I hate accidentally consuming things when looping over them to find they're now gone, so just tend to do that for safety when I know the list is small, mainly just out of habit. It's not necessary here, but it's also probably less harmful than not doing it, on balance.
log = logging.getLogger(__name__) | ||
|
||
commands = ensure_iterable(commands) | ||
commands = list(ensure_iterable(commands)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question as above...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM at a coding level, one minor question. You may still want Tiago's eyes for possible impact to the broader codebase?
Thanks. Should be fine though, this can't affect anything in Tiago-town (expect making it easier for him to use this code to debug things 🙂) |
No description provided.