You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For KafkaConsumer.subscribe() either topics or pattern must be specified but not both. While experimenting, I noticed that when I break this contract, I get an AssertionError.
Since this is caused by bad input, and not bad code, this should throw ValueError not AssertionError.
Assertions will get stripped out if python is run with the optimized flag, removing the safety net of this check. While rare in dev, some places do run python this way in production.
Happy to put together a PR if you want, but wanted to doublecheck you're on board with this change.
The text was updated successfully, but these errors were encountered:
Also note that technically what is raised is IllegalStateError which isn't strictly an assertion. This was done to mirror the java client, which I believe raises a similar error in this case.
For
KafkaConsumer.subscribe()
eithertopics
orpattern
must be specified but not both. While experimenting, I noticed that when I break this contract, I get anAssertionError
.Since this is caused by bad input, and not bad code, this should throw
ValueError
notAssertionError
.Assertions will get stripped out if python is run with the optimized flag, removing the safety net of this check. While rare in dev, some places do run python this way in production.
Happy to put together a PR if you want, but wanted to doublecheck you're on board with this change.
The text was updated successfully, but these errors were encountered: