owl icon indicating copy to clipboard operation
owl copied to clipboard

Owl_io.head: avoid log message about assertion failure on large CSV file

Open edwintorok opened this issue 1 year ago • 0 comments

Executing Owl_dataframe.of_csv "large.csv" prints:

2023-04-13 14:01:52.922 WARN : Owl_io.head: ignored exception File "src/base/misc/owl_io.ml", line 138, characters 9-15: Assertion failed

Using assertions for control-flow (early exit of loop) seems wrong, and causes log messages to be shown on the console. Raise an [End_of_file] exception instead which will be handled by the iteration function just as if the file ended early. Use [raise_notrace] because the exception is immediately caught and we don't need a backtrace.

edwintorok avatar Apr 13 '23 17:04 edwintorok