---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[152], line 7
3 def say_hello(file_path: str) -> None:
4 print(f"Hello {file_path}!")
6 pipeline = ak.chain(
----> 7 ak.step("hi", say_hello),
8 )
10 ak.run(pipeline, input={"file_path": "world!"}).to_frame()
File ~/.pyenv/versions/3.11.9/envs/rai_red_ft/lib/python3.11/site-packages/fluxus/functional/_functions.py:242, in step(_name, _function_or_data, **kwargs)
234 return DictProducer(
235 lambda: aiter(cast(AsyncIterable[Mapping[str, Any]], _function_or_data)),
236 name=_name,
237 )
238 elif (
239 not isinstance(_function_or_data, FunctionType)
240 or _function_or_data.__code__.co_varnames
241 ):
--> 242 return Step(_name, _function_or_data, **kwargs)
243 else:
244 return DictProducer(_function_or_data, name=_name)
File ~/.pyenv/versions/3.11.9/envs/rai_red_ft/lib/python3.11/site-packages/fluxus/functional/conduit/_step.py:178, in Step.__init__(self, _name, _function, **kwargs)
172 if invalid_kwargs:
173 raise ValueError(
174 "Names of keyword arguments must be valid identifiers, but got: "
175 + ", ".join(map(repr, invalid_kwargs))
176 )
--> 178 function_arguments = _validate_function(
179 step=_name, function=_function, kwargs=kwargs
180 )
181 self._name = _name
182 self._function = _function
File ~/.pyenv/versions/3.11.9/envs/rai_red_ft/lib/python3.11/site-packages/fluxus/functional/conduit/_step.py:418, in _validate_function(step, function, kwargs)
411 if return_annotation is None: # pragma: no cover
412 # This should never happen
413 raise TypeError(
414 f"Return type of function {function.__name__} of step {step!r} "
415 f"is a forward reference that cannot be resolved: "
416 f"{return_annotation!r}"
417 )
--> 418 if not any(
419 issubclass_generic(return_annotation, tp)
420 for tp in (
421 Mapping[str, Any],
422 Iterable[Mapping[str, Any]],
423 AsyncIterable[Mapping[str, Any]],
424 Awaitable[Mapping[str, Any]],
425 )
426 ):
427 raise TypeError(
428 f"Return type of function {function.__name__} of step {step!r} must be "
429 "one of Mapping[str, Any], Iterable[Mapping[str, Any]], or "
430 f"AsyncIterable[Mapping[str, Any]], but got: {return_annotation}"
431 )
433 return function_arguments
File ~/.pyenv/versions/3.11.9/envs/rai_red_ft/lib/python3.11/site-packages/fluxus/functional/conduit/_step.py:419, in <genexpr>(.0)
411 if return_annotation is None: # pragma: no cover
412 # This should never happen
413 raise TypeError(
414 f"Return type of function {function.__name__} of step {step!r} "
415 f"is a forward reference that cannot be resolved: "
416 f"{return_annotation!r}"
417 )
418 if not any(
--> 419 issubclass_generic(return_annotation, tp)
420 for tp in (
421 Mapping[str, Any],
422 Iterable[Mapping[str, Any]],
423 AsyncIterable[Mapping[str, Any]],
424 Awaitable[Mapping[str, Any]],
425 )
426 ):
427 raise TypeError(
428 f"Return type of function {function.__name__} of step {step!r} must be "
429 "one of Mapping[str, Any], Iterable[Mapping[str, Any]], or "
430 f"AsyncIterable[Mapping[str, Any]], but got: {return_annotation}"
431 )
433 return function_arguments
File ~/.pyenv/versions/3.11.9/envs/rai_red_ft/lib/python3.11/site-packages/pytools/typing/_typing.py:399, in issubclass_generic(subclass, base)
396 elif base is Never:
397 return False
--> 399 subclass = _replace_deprecated_type(subclass)
400 base = _replace_deprecated_type(base)
402 # Get the non-generic origin of the base class
File ~/.pyenv/versions/3.11.9/envs/rai_red_ft/lib/python3.11/site-packages/pytools/typing/_typing.py:580, in _replace_deprecated_type(tp)
570 def _replace_deprecated_type(tp: type) -> type:
571 """
572 Replace deprecated types in :mod:`typing` with their canonical replacements in
573 :mod:`collections.abc`.
(...)
577 deprecated
578 """
--> 580 if tp.__module__ == "typing":
581 # Check if the same type is defined in collections.abc
582 origin: type | None = get_origin(tp)
583 if origin is not None and origin.__module__ == "collections.abc":
AttributeError: 'NoneType' object has no attribute '__module__'