Repository navigation
fix(create_inputs): skip empty optional File/Directory inputs - #13
Merged
Merged
Conversation
Optional File?/Directory? inputs left empty at submission are now omitted from inputs.yml instead of crashing on os.path.basename(None) or attempting STAC staging from an empty URI. Empty required File/Directory inputs fail early with a clear error. Closes #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12
Problem
hysds-ogc-container-builderwritesoptional: truewith no default forFile?/Directory?inputs. When the user leaves one empty,validate_job_submitdrops it from the job, andmap_inputs_from_contextthen:File?: callsos.path.basename(None)→TypeError, so the job fails before cwltool runs. A""value instead produced a bogus{"class": "File", "path": "<cwd>"}.Directory?: callsload_json_from_uri(None), so STAC staging fails.Change
Before the
File/Directorybranches inmap_inputs_from_context:""or"None"(the same empty valuesconvert_value_to_cwl_typetreats as empty) and the type is optional → skip the input, so cwltool passes no flag to the algorithm.ValueErrornaming the input.Primitive-type handling is unchanged.
Tests
New
tests/test_create_inputs.py(19 tests):File?/Directory?(both["null", T]andT?forms; missing,"","None") are omitted, and STAC staging isn't called.File/Directoryraises.File/Directoryvalues still map and stage as before.Note:
tests/test_stage_in.py::TestStacMetadataPreservationhas 2 failures (test_stac_extensions_preserved,test_self_href_set_to_local_path) that also fail on unmodifieddevelop. They're unrelated to this change.