datajudge icon indicating copy to clipboard operation
datajudge copied to clipboard

Fault tolerant error handling on invalid Condition()

Open windiana42 opened this issue 2 years ago • 1 comments

One can see it as a user error that Condition(rawstring="col is not NULL") fails if col does not exist in table. However, the general concept of datajudge seems to be to handle errors fault tolerant and to report a list of errors at the end. Thus it might be nice to try-catch also plain query related errors and to report those fault tolerant at the end as well.

It may be a conscious decision to only handle value errors fault tolerant and structural problems fail fast. So feel free to reject this issue. I don't have long user experience with datajudge, yet. I am just helping a team use it.

windiana42 avatar May 30 '23 08:05 windiana42

Hi @windiana42 - thanks for raising this issue!

Thus it might be nice to try-catch also plain query related errors and to report those fault tolerant at the end as well.

As of now, If the column referenced in a Condition does not exist in the table at hand, every Constraint relying on it will lead to a test failure, e.g.

FAILED tests/integration/test_data_source.py::test_uniques_subset_between_expression[postgres-data3] - sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column "colz_int" does not exist

What would be your desired behaviour? Merely a more explicit test failure message or some mechanism preventing the test(s) to be run in the first place?

kklein avatar May 31 '23 16:05 kklein