Skip to content

Commit

Permalink
checking ontology availability before posixPath check
Browse files Browse the repository at this point in the history
  • Loading branch information
burnout87 committed Aug 27, 2024
1 parent 88c967b commit 34074ef
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nb2workflow/nbadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,16 @@ def download_file(self, file_url, tmpdir):
def handle_url_params(self, parameters, tmpdir, context={}):
adapted_parameters = copy.deepcopy(parameters)
exceptions = []
ontology_available = False
if len(ontology.g) > 0:
ontology_available = True
for input_par_name, input_par_obj in self.input_parameters.items():
parameter_hierarchy = ontology.get_parameter_hierarchy(input_par_obj['owl_type'])
if f"{oda_prefix}POSIXPath" in parameter_hierarchy:
if ontology_available:
parameter_hierarchy = ontology.get_parameter_hierarchy(input_par_obj['owl_type'])
is_posix_path = f"{oda_prefix}POSIXPath" in parameter_hierarchy
else:
is_posix_path = f"{oda_prefix}POSIXPath" in input_par_obj['owl_type']
if is_posix_path:
arg_par_value = parameters.get(input_par_name, None)
if arg_par_value is None:
arg_par_value = input_par_obj['default_value']
Expand Down

0 comments on commit 34074ef

Please sign in to comment.