When using Any
a TypeError is thrown: isinstance() arg 2 must be a type or tuple of types
#47
Labels
bug
Something isn't working
Using HuggingFace datasets:
`from datasets import load_dataset
@sematic.func
def pipeline() -> Any:
dataset = load_yelp_dataset()
return dataset
@sematic.func
def load_yelp_dataset() -> Any:
dataset = load_dataset("yelp_review_full")
print(type(dataset))
return dataset`
When using
DatasetDict
instead ofAny
it worksHere is the stack trace:
Traceback (most recent call last): File "/Users/jai/opt/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Users/jai/opt/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/jai/projects/sematic/my_project/__main__.py", line 17, in <module> main() File "/Users/jai/projects/sematic/my_project/__main__.py", line 13, in main pipeline().resolve() File "/Users/jai/projects/sematic/sematic/future.py", line 21, in resolve self.value = resolver.resolve(self) File "/Users/jai/projects/sematic/sematic/resolvers/state_machine_resolver.py", line 28, in resolve self._schedule_future_if_input_ready(future_) File "/Users/jai/projects/sematic/sematic/resolvers/state_machine_resolver.py", line 220, in _schedule_future_if_input_ready self._schedule_future(future) File "/Users/jai/projects/sematic/sematic/resolvers/offline_resolver.py", line 84, in _schedule_future self._run_inline(future) File "/Users/jai/projects/sematic/sematic/resolvers/offline_resolver.py", line 93, in _run_inline self._handle_future_failure(future, exception) File "/Users/jai/projects/sematic/sematic/resolvers/state_machine_resolver.py", line 242, in _handle_future_failure raise exception File "/Users/jai/projects/sematic/sematic/resolvers/offline_resolver.py", line 91, in _run_inline self._update_future_with_value(future, value) File "/Users/jai/projects/sematic/sematic/resolvers/state_machine_resolver.py", line 271, in _update_future_with_value value = future.calculator.cast_output(value) File "/Users/jai/projects/sematic/sematic/calculator.py", line 131, in cast_output return self.cast_value( File "/Users/jai/projects/sematic/sematic/calculator.py", line 155, in cast_value cast_value, error = safe_cast(value, type_) File "/Users/jai/projects/sematic/sematic/types/casting.py", line 95, in safe_cast if isinstance(value, type_): TypeError: isinstance() arg 2 must be a type or tuple of types
The text was updated successfully, but these errors were encountered: