dcmoura / spyql

Query data on the command line with SQL-like SELECTs powered by Python expressions
https://spyql.readthedocs.io
MIT License
918 stars 25 forks source link

Exception handling for data issues #6

Closed dcmoura closed 3 years ago

dcmoura commented 3 years ago

Exception handling is of uttermost importance. There are several situations where exceptions are raised due to the data and not to programming errors. These should be dealt with so that execution is not halted. Instead, NULL/None values should result from the evaluation (e.g. NULL/None values, JSON field missing, casting empty strings to numeric). Optionally, warnings should be sent to stderr. This issue should cover, at least the following exceptions, always returning None:

Note: in the future, a coalesce function should be available that is able to handle these exceptions and replacing None by a value/expression. (look into #3)