NCEAS / metadig-engine

MetaDig Engine: multi-dialect metadata assessment engine
7 stars 5 forks source link

make python checks compatible with Python3 #387

Closed jeanetteclark closed 10 months ago

jeanetteclark commented 11 months ago

In testing the Jep implementation, I discovered that a decent amount of existing python checks are not compatible with Python3.

We need to update those checks to work with python 3. The most common issue is the use of the type unicode which should just be str in python 3. The process for this is looking like

jeanetteclark commented 11 months ago

Current list of checks not working and their errors:

check_id status output
entity.distributionURL.resolvable.1 FAILURE ERROR: jep.JepException: <class 'TypeError'>: isinstance() arg 2 must be a type, a tuple of types, or a union
entity.format.nonproprietary.1 FAILURE ERROR: jep.JepException: <class '_csv.Error'>: iterator should return strings, not bytes (the file should be opened in text mode)
entity.identifier.present.1 FAILURE ERROR: jep.JepException: <class 'TypeError'>: isinstance() arg 2 must be a type, a tuple of types, or a union
entity.type.nonproprietary-1.0.0 FAILURE ERROR: jep.JepException: <class '_csv.Error'>: iterator should return strings, not bytes (the file should be opened in text mode)
resource.awardFunderName.controlled-1.0.0 FAILURE ERROR: jep.JepException: <class 'ModuleNotFoundError'>: No module named 'java.util.ArrayList'
resource.creatorIdentifier.present.1 FAILURE ERROR: jep.JepException: <class 'TypeError'>: isinstance() arg 2 must be a type, a tuple of types, or a union
resource.distributionContact.present.1 FAILURE ERROR: jep.JepException: <class 'TypeError'>: isinstance() arg 2 must be a type, a tuple of types, or a union
resource.distributionContactIdentifier.present.1 FAILURE ERROR: jep.JepException: <class 'TypeError'>: isinstance() arg 2 must be a type, a tuple of types, or a union
resource.license.present.1 FAILURE ERROR: jep.JepException: <class 'TypeError'>: isinstance() arg 2 must be a type, a tuple of types, or a union
resource.URLs.resolvable-1.0.0 FAILURE ERROR: jep.JepException: <class 'TypeError'>: isinstance() arg 2 must be a type, a tuple of types, or a union
jeanetteclark commented 10 months ago

got all the checks working, and checked in to develop over on metadig-checks