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
[X] Pull request has descriptive title
[X] Pull request gives overview of changes
[X] (N/A) New code has inline comments where necessary
[X] (N/A) Any new modules, functions or classes have docstrings consistent with dbprocessing style
[X] (N/A) Major new functionality has appropriate Sphinx documentation
[X] (N/A) Added an entry to release notes if fixing a major bug or providing a major new feature
[X] (see above) New features and bug fixes should have unit tests
[X] (N/A) Relevant issues are linked in the description (use Closes # if this PR closes the issue, or some other reference, such as See # if it is related in some other way)
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
Closes #
if this PR closes the issue, or some other reference, such asSee #
if it is related in some other way)