Skip to content

Add file_extension, enable_legacy_filename fields to BlobType#3412

Closed
ddl-rliu wants to merge 5 commits intoflyteorg:masterfrom
dominodatalab:rliu.DOM-75010.file-ext3
Closed

Add file_extension, enable_legacy_filename fields to BlobType#3412
ddl-rliu wants to merge 5 commits intoflyteorg:masterfrom
dominodatalab:rliu.DOM-75010.file-ext3

Conversation

@ddl-rliu
Copy link
Copy Markdown
Contributor

Upstream #3406

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

mhotan and others added 5 commits April 23, 2025 07:53
* Adds ImageSpec.with_runtime_packages (flyteorg#3231)

* Adds ImageSpec.with_dev_dependencies

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Fix

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Add tests for noop builder

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Use runtime_packages

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Add docs abount how to use runtime packages

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Less diffs

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Fix formatting

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Fix docstring

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Dix docstring

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Let pip default to user by itself to be more compatible

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

---------

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>

* Image spec builder options (flyteorg#3233)

* Image spec builder options

Provide the ability to specify image `builder` specific options per
Image Spec.

Signed-off-by: Mike Hotan <mike@union.ai>

* Add builder_options validation

Signed-off-by: Mike Hotan <mike@union.ai>

* updates

Signed-off-by: Mike Hotan <mike@union.ai>

---------

Signed-off-by: Mike Hotan <mike@union.ai>

---------

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Signed-off-by: Mike Hotan <mike@union.ai>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
- This is necessary due to another pending PR to upstream flytekit:
  flyteorg#2428

  In case this PR is not likely to be merged, we have a plan to move away
  from this change, see the linked Doc in DOM-57472
Signed-off-by: ddl-rliu <richard.liu@dominodatalab.com>
## Why are the changes needed?

`bytes` is more flexible. This flexibility is relevant when including the serialized input bindings (bytes) in the version hash calculations. This is necessary to fix a bug that can occur:

There is a bug where Flyte rejects a valid workflow. This can happen when workflow inputs are read from a file, causing the workflow input bindings to be updated, without an update to the version.

## What changes were proposed in this pull request?

Refactor version_hash_additional_context, which currently uses `str`, to use `bytes`
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
Copy link
Copy Markdown
Contributor Author

Closing in favor of #3406

@ddl-rliu ddl-rliu closed this Mar 25, 2026
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

2 participants