2525 AsyncTypeTransformer ,
2626 TypeEngine ,
2727 TypeTransformerFailedError ,
28- get_file_download_config ,
2928 get_underlying_type ,
3029)
3130from flytekit .exceptions .user import FlyteAssertion
@@ -450,26 +449,8 @@ def get_format(t: typing.Union[typing.Type[FlyteFile], os.PathLike]) -> str:
450449 return ""
451450 return cast (FlyteFile , t ).extension ()
452451
453- @staticmethod
454- def get_file_extension (t : typing .Union [typing .Type [FlyteFile ], os .PathLike ]) -> str :
455- if t is os .PathLike :
456- return ""
457- file_download_config = get_file_download_config (t )
458- if file_download_config is None :
459- return ""
460- return file_download_config .file_extension or ""
461-
462- @staticmethod
463- def get_enable_legacy_filename (t : typing .Union [typing .Type [FlyteFile ], os .PathLike ]) -> str :
464- if t is os .PathLike :
465- return False
466- file_download_config = get_file_download_config (t )
467- if file_download_config is None :
468- return False
469- return file_download_config .enable_legacy_filename or False
470-
471- def _blob_type (self , format : str , file_extension : str = "" , enable_legacy_filename : bool = False ) -> BlobType :
472- return BlobType (format = format , dimensionality = BlobType .BlobDimensionality .SINGLE , file_extension = file_extension , enable_legacy_filename = enable_legacy_filename )
452+ def _blob_type (self , format : str ) -> BlobType :
453+ return BlobType (format = format , dimensionality = BlobType .BlobDimensionality .SINGLE )
473454
474455 def assert_type (
475456 self , t : typing .Union [typing .Type [FlyteFile ], os .PathLike ], v : typing .Union [FlyteFile , os .PathLike , str ]
@@ -482,11 +463,7 @@ def assert_type(
482463 )
483464
484465 def get_literal_type (self , t : typing .Union [typing .Type [FlyteFile ], os .PathLike ]) -> LiteralType :
485- return LiteralType (blob = self ._blob_type (
486- format = FlyteFilePathTransformer .get_format (t ),
487- file_extension = FlyteFilePathTransformer .get_file_extension (t ),
488- enable_legacy_filename = FlyteFilePathTransformer .get_enable_legacy_filename (t ),
489- ))
466+ return LiteralType (blob = self ._blob_type (format = FlyteFilePathTransformer .get_format (t )))
490467
491468 def get_mime_type_from_extension (self , extension : str ) -> typing .Union [str , typing .Sequence [str ]]:
492469 extension_to_mime_type = {
@@ -560,11 +537,7 @@ async def async_to_literal(
560537 raise ValueError (f"Incorrect type { python_type } , must be either a FlyteFile or os.PathLike" )
561538
562539 # information used by all cases
563- meta = BlobMetadata (type = self ._blob_type (
564- format = FlyteFilePathTransformer .get_format (python_type ),
565- file_extension = FlyteFilePathTransformer .get_file_extension (python_type ),
566- enable_legacy_filename = FlyteFilePathTransformer .get_enable_legacy_filename (python_type ),
567- ))
540+ meta = BlobMetadata (type = self ._blob_type (format = FlyteFilePathTransformer .get_format (python_type )))
568541
569542 if isinstance (python_val , FlyteFile ):
570543 # Cast the source path to str type to avoid error raised when the source path is used as the blob uri,
0 commit comments