Skip to content

Commit

Permalink
fix5: use if any
Browse files Browse the repository at this point in the history
  • Loading branch information
jsitarova-dnanexus committed Oct 10, 2024
1 parent 461d03e commit 09c0c25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/python/dxpy/bindings/dxapplet.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ def _get_run_input_common_fields(executable_input, **kwargs):
if kwargs.get(arg) is not None:
run_input[arg] = kwargs[arg]

if any(kwargs.get(key) is not None for key in
['instance_type', 'cluster_spec', 'fpga_driver', 'nvidia_driver']):
if any(kwargs.get(key) is not None for key in ['instance_type', 'cluster_spec', 'fpga_driver', 'nvidia_driver']):
instance_type_srd = SystemRequirementsDict.from_instance_type(kwargs.get('instance_type'))
cluster_spec_srd = SystemRequirementsDict(kwargs.get('cluster_spec'))
fpga_driver_srd = SystemRequirementsDict(kwargs.get('fpga_driver'))
Expand Down
2 changes: 1 addition & 1 deletion src/python/dxpy/bindings/dxjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def new(self, fn_input, fn_name, name=None, tags=None, properties=None, details=
req_input["tags"] = tags
if properties is not None:
req_input["properties"] = properties
if instance_type is not None or cluster_spec is not None or fpga_driver is not None or nvidia_driver is not None:
if any(requirement is not None for requirement in [instance_type, cluster_spec, fpga_driver, nvidia_driver]):
instance_type_srd = SystemRequirementsDict.from_instance_type(instance_type, fn_name)
cluster_spec_srd = SystemRequirementsDict(cluster_spec)
fpga_driver_srd = SystemRequirementsDict(fpga_driver)
Expand Down

0 comments on commit 09c0c25

Please sign in to comment.