sparse-carpenter-66912
08/18/2025, 8:06 AMValueError: as_type argument not supplied and Variable map not specified in LiteralsResolver
remote = UnionRemote.for_endpoint("eidu.eu-west-1.unionai.cloud")
response = remote.get("flyte://<path-to-flyte>/n4/o")
print(response)
# download file from s3
s3 = s3fs.S3FileSystem()
s3.download(response.get("o0"), Path("data") / "saved_model.keras")
Do I need to supply it with a type? I just want to download the filejolly-florist-66728
08/18/2025, 8:06 AMjolly-florist-66728
08/18/2025, 8:07 AMas_type=FlyteFile
to ensure the output is returned as a FlyteFile object, which provides a .download()
method to fetch the file locally. Your code should look like this:
from flytekit.remote.remote import FlyteRemote
from flytekit.types.file import FlyteFile
remote = FlyteRemote.for_endpoint("eidu.eu-west-1.unionai.cloud")
response = remote.get("flyte://<path-to-flyte>/n4/o", as_type=FlyteFile)
local_path = response["o0"].download() # Downloads the file to a local temp path
print(f"Downloaded file to: {local_path}")
This approach avoids the error and handles the download for you. You do not need to use s3fs directly—FlyteFile manages the download from S3 or other remote storage automatically.
Would you like more detail on how FlyteFile works or how to specify other types?
Sources:
- FlyteFile implementation
- Related GitHub issue: dataclass and pydantic both failed when using Flytekit Remote API 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.sparse-carpenter-66912
08/18/2025, 8:25 AMjolly-florist-66728
08/18/2025, 8:25 AMjolly-florist-66728
08/18/2025, 8:26 AMaws sts assume-role
or AWS SSO).
- Add your AWS user to the S3 bucket policy (not recommended for production).
- Download via FlyteFile’s .download()
method, which uses your current credentials, so you must have S3 access.
Would you like more detail on configuring IAM roles or using IRSA with Flyte?
Sources:
- https://github.com/flyteorg/flyte/issues/2771
- https://github.com/flyteorg/flyte/issues/6438 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.