GetDKAN / dkan

DKAN Open Data Portal
https://dkan.readthedocs.io/en/latest/index.html
GNU General Public License v2.0
374 stars 172 forks source link

Datastore MySQL Import handles empty file incorrect #4273

Closed stefan-korn closed 2 months ago

stefan-korn commented 2 months ago

Current Behavior

The Datastore MySQL import submodule handles an empty file incorrect (differently than the import via CSV parser) resulting in an error during execution of the import: ValueError: fread(): Argument #2 ($length) must be greater than 0 in fread()

This will lead to termination of the import job, while compared with the import via CSV parser (without Datastore MySQL import module) the import job will continue and just mark the empty file with an error in the import status.

Expected Behavior

Datastore MySQL import should show the same behavior on import of an empty file as the import via CSV parser (mark the file as an error in import status, but not terminate the whole import job).

Steps To Reproduce

Compare this to:

Relevant log output (optional)

No response

Anything else?

No response