Skip to content

Commit a7374aa

Browse files
Drop BaseSpec from possible types for input_spec
1 parent 5c0914b commit a7374aa

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

pydra/engine/core.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -798,17 +798,17 @@ def _reset(self):
798798

799799

800800
def _sanitize_input_spec(
801-
input_spec: ty.Union[BaseSpec, ty.List[str]],
801+
input_spec: ty.Union[SpecInfo, ty.List[str]],
802802
wf_name: str,
803-
) -> BaseSpec:
803+
) -> SpecInfo:
804804
"""Makes sure the provided input specifications are valid.
805805
806806
If the input specification is a list of strings, this will
807807
build a proper SpecInfo object out of it.
808808
809809
Parameters
810810
----------
811-
input_spec : BaseSpec or List[str]
811+
input_spec : SpecInfo or List[str]
812812
Input specification to be sanitized.
813813
814814
wf_name : str
@@ -817,7 +817,7 @@ def _sanitize_input_spec(
817817
818818
Returns
819819
-------
820-
input_spec : BaseSpec
820+
input_spec : SpecInfo
821821
Sanitized input specifications.
822822
823823
Raises
@@ -827,9 +827,7 @@ def _sanitize_input_spec(
827827
"""
828828
graph_checksum_input = ("_graph_checksums", ty.Any)
829829
if input_spec:
830-
if isinstance(input_spec, BaseSpec):
831-
return input_spec
832-
elif isinstance(input_spec, SpecInfo):
830+
if isinstance(input_spec, SpecInfo):
833831
if not any([x == BaseSpec for x in input_spec.bases]):
834832
raise ValueError("Provided SpecInfo must have BaseSpec as it's base.")
835833
if "_graph_checksums" not in {f[0] for f in input_spec.fields}:
@@ -866,7 +864,7 @@ def __init__(
866864
audit_flags: AuditFlag = AuditFlag.NONE,
867865
cache_dir=None,
868866
cache_locations=None,
869-
input_spec: ty.Optional[ty.Union[ty.List[ty.Text], SpecInfo, BaseSpec]] = None,
867+
input_spec: ty.Optional[ty.Union[ty.List[ty.Text], SpecInfo]] = None,
870868
cont_dim=None,
871869
messenger_args=None,
872870
messengers=None,

0 commit comments

Comments
 (0)