RedisGraph / redisgraph-py

RedisGraph python client
https://redisgraph.io
BSD 3-Clause "New" or "Revised" License
189 stars 49 forks source link

assert shall not be used in production code (control flow) #83

Open boris-42 opened 4 years ago

boris-42 commented 4 years ago

Asserts should be used only in tests, and should not be used in production code, like here and in other places

https://github.com/RedisGraph/redisgraph-py/blob/master/redisgraph/path.py#L7

There are 2 problems: 1) If you run with python -o, all these asserts will be ignored and code will stop working 2) It's a best practice to use own Exceptions or at least default like ValueError with human readable messages