civisanalytics / civis-python

Civis API Python Client
BSD 3-Clause "New" or "Revised" License
34 stars 26 forks source link

[CIVIS-1609] FIX no `assert` statements in non-test code #430

Closed jacksonlee-civis closed 2 years ago

jacksonlee-civis commented 2 years ago

assert statements shouldn't be used in the actual, non-test code, since they can be disabled by the -O flag: https://docs.python.org/3/using/cmdline.html#cmdoption-O It's not clear how likely folks would run Civis-related code with this flag on, but it's better to convert these assert statements into conditional statements with exception raising.