We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataclass transformer does not work with frozen dataclasses
Dataclass transformer should work with frozen dataclasses
from dataclasses import dataclass from flytekit import task @dataclass(frozen=True) class DummyDataclass: x: int = 1 @task def dummy_task(dc: DummyDataclass) -> int: return dc.x if __name__ == "__main__": dummy_task(dc=DummyDataclass(x=1))
/Users/ggydush/dev/delve/clinical-pipeline/clinical_pipeline/core/dataclasses/tmp.py:17 in <module> │ │ │ │ ❱ 17 │ dummy_task(dc=DummyDataclass(x=1)) │ │ │ │ /Users/ggydush/.virtualenvs/clinical-pipeline-ErT9kUro-py3.11/lib/python3.11/site-packages/flytekit/core/base_task.py:358 in __call__ │ │ │ │ ❱ 358 │ │ return flyte_entity_call_handler(self, *args, **kwargs) # type: ignore │ │ │ │ /Users/ggydush/.virtualenvs/clinical-pipeline-ErT9kUro-py3.11/lib/python3.11/site-packages/flytekit/core/promise.py:1256 in flyte_entity_call_handler │ │ │ │ ❱ 1256 │ │ │ result = cast(LocallyExecutable, entity).local_execute(child_ctx, **kwargs) │ │ │ │ /Users/ggydush/.virtualenvs/clinical-pipeline-ErT9kUro-py3.11/lib/python3.11/site-packages/flytekit/core/base_task.py:285 in local_execute │ │ │ │ ❱ 285 │ │ │ kwargs = translate_inputs_to_literals( │ │ │ │ /Users/ggydush/.virtualenvs/clinical-pipeline-ErT9kUro-py3.11/lib/python3.11/site-packages/flytekit/core/promise.py:95 in translate_inputs_to_literals │ │ │ │ ❱ 95 │ │ │ result[k] = TypeEngine.to_literal(ctx, v, t, var.type) │ │ │ │ /Users/ggydush/.virtualenvs/clinical-pipeline-ErT9kUro-py3.11/lib/python3.11/site-packages/flytekit/core/type_engine.py:1174 in to_literal │ │ │ │ ❱ 1174 │ │ lv = transformer.to_literal(ctx, python_val, python_type, expected) │ │ │ │ /Users/ggydush/.virtualenvs/clinical-pipeline-ErT9kUro-py3.11/lib/python3.11/site-packages/flytekit/core/type_engine.py:485 in to_literal │ │ │ │ ❱ 485 │ │ self._serialize_flyte_type(python_val, python_type) │ │ │ │ /Users/ggydush/.virtualenvs/clinical-pipeline-ErT9kUro-py3.11/lib/python3.11/site-packages/flytekit/core/type_engine.py:597 in _serialize_flyte_type │ │ │ │ ❱ 597 │ │ │ │ python_val.__setattr__(v.name, self._serialize_flyte_type(val, field_typ │ │ in __setattr__:4 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ FrozenInstanceError: cannot assign to field 'x'
No response
The text was updated successfully, but these errors were encountered:
eapolinario
Future-Outlier
No branches or pull requests
Describe the bug
Dataclass transformer does not work with frozen dataclasses
Expected behavior
Dataclass transformer should work with frozen dataclasses
Additional context to reproduce
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: