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
The dataclass type transformer does not handle fields of type Optional[FlyteFile] correctly.
Optional[FlyteFile]
For example, this workflow fails:
from dataclasses import dataclass from typing import Optional from dataclasses_json import dataclass_json from flytekit import workflow, task from flytekit.types.file import FlyteFile @dataclass_json @dataclass class TaskOutput: file1: FlyteFile file2: Optional[FlyteFile] @task def task1() -> TaskOutput: with open("file21.txt", "w+") as f: f.write("b") with open("file22.txt", "w+") as f: f.write("c") return TaskOutput( FlyteFile("file21.txt", remote_path="s3://my-s3-bucket/tmp/file21.txt"), FlyteFile("file22.txt", remote_path="s3://my-s3-bucket/tmp/file22.txt") ) @task def assert_values_in_dataclass(to: TaskOutput): assert to.file1.remote_source == "s3://my-s3-bucket/tmp/file21.txt" assert to.file2.remote_source == "s3://my-s3-bucket/tmp/file22.txt" @workflow def wf(): to = task1() assert_values_in_dataclass(to=to)
Optional[FlyteFile] should be allowed in Dataclasses.
No response
The text was updated successfully, but these errors were encountered:
eapolinario
No branches or pull requests
Describe the bug
The dataclass type transformer does not handle fields of type
Optional[FlyteFile]
correctly.For example, this workflow fails:
Expected behavior
Optional[FlyteFile]
should be allowed in Dataclasses.Additional context to reproduce
No response
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: