Skip to content

Add file_extension, enable_legacy_filename fields to BlobType#3406

Draft
ddl-rliu wants to merge 1 commit intoflyteorg:masterfrom
ddl-rliu:rliu.DOM-75010.file-ext2
Draft

Add file_extension, enable_legacy_filename fields to BlobType#3406
ddl-rliu wants to merge 1 commit intoflyteorg:masterfrom
ddl-rliu:rliu.DOM-75010.file-ext2

Conversation

@ddl-rliu
Copy link
Contributor

@ddl-rliu ddl-rliu commented Mar 12, 2026

See flyteorg/flyte#7009

This is a draft PR, since it depends on the flyte PR, and the approach proposed in the flyte PR is not finalized.

Tracking issue

Closes flyteorg/flyte#7024

Why are the changes needed?

What changes were proposed in this pull request?

Add file_extension, enable_legacy_filename fields to BlobType. Add annotation "FileDownloadConfig".

The annotation "FileDownloadConfig" is used to annotate a FlyteFile when we want to download the file with a specific extension. For example,

# ContainerTask
def t1(file: Annotated[FlyteFile, FileDownloadConfig(file_extension="csv")]):
    ... # copilot downloads the file to e.g. /inputs/file.csv

versus...

def t1(file: FlyteFile["csv"]):
    ... # copilot downloads the file to e.g. /inputs/file

Under the hood, this sets file_extension, enable_legacy_filename in BlobType, and depends on flyteorg/flyte#7009

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

"docker>=4.0.0",
"docstring-parser>=0.9.0",
"flyteidl>=1.16.1,<2.0.0a0",
"flyteidl @ git+https://github.com/dominodatalab/flyteidl.git@af517f6",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump this after flyteorg/flyte#7009 merges

return None


class FileDownloadConfig:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follows same pattern as BatchSize:

class BatchSize:

Port new BlobType fields file_extension and enable_legacy_filename to flytekit.
FlyteFile inputs can be annotated with the FileDownloadConfig annotation to
configure the file extension to use during the copilot download phase.

e.g.

```python
def t1(file: Annotated[FlyteFile, FileDownloadConfig(file_extension="csv")]):
    ... # copilot downloads the file to e.g. /inputs/file.csv

versus...

def t1(file: FlyteFile["csv"]):
    ... # copilot downloads the file to e.g. /inputs/file
```
@ddl-rliu ddl-rliu force-pushed the rliu.DOM-75010.file-ext2 branch from caaa6f8 to 8ec4ae4 Compare March 12, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [copilot] File extensions are missing when copilot downloads Blob/FlyteFile inputs

1 participant