spacepy / dbprocessing

Automated processing controller for heliophysics data
5 stars 4 forks source link

Fix addFromConfig for processes with no output product #79

Closed jtniehof closed 3 years ago

jtniehof commented 3 years ago

addFromConfig no longer works for processes with no output product on Python 2.7. This is due to a comparison of empty strings with "is" in a situation where one might be in Unicode. This comparison has been around for awhile--I think it only became a problem when some of the config file handling was consolidated into a single place, and not explicitly cast to str in Python 2.

This PR changes to a simple equality comparison. It also adds a unit test to addFromConfig for the no-output case. It's worth noting the unit test does not catch the problem, as it's in the non-unit-tested (and not really easily testable) portion of addFromConfig. In lieu of that, I assert that the PSP config does not successfully load into a database with the previous addFromConfig, but does work with this PR.

Long-term we need to rearchitect addFromConfig to be more testable, but a story for another day.

PR Checklist