@@ -604,3 +604,26 @@ def test_write_manifest_list(
604604 assert entry .file_sequence_number == 0 if format_version == 1 else 3
605605 assert entry .snapshot_id == 8744736658442914487
606606 assert entry .status == ManifestEntryStatus .ADDED
607+
608+
609+ @pytest .mark .parametrize (
610+ "raw_file_format,expected_file_format" ,
611+ [
612+ ("avro" , FileFormat ("AVRO" )),
613+ ("AVRO" , FileFormat ("AVRO" )),
614+ ("parquet" , FileFormat ("PARQUET" )),
615+ ("PARQUET" , FileFormat ("PARQUET" )),
616+ ("orc" , FileFormat ("ORC" )),
617+ ("ORC" , FileFormat ("ORC" )),
618+ ("NOT_EXISTS" , None ),
619+ ],
620+ )
621+ def test_file_format_case_insensitive (raw_file_format : str , expected_file_format : FileFormat ) -> None :
622+ if expected_file_format :
623+ parsed_file_format = FileFormat (raw_file_format )
624+ assert parsed_file_format == expected_file_format , (
625+ f"File format { raw_file_format } : { parsed_file_format } != { expected_file_format } "
626+ )
627+ else :
628+ with pytest .raises (ValueError ):
629+ _ = FileFormat (raw_file_format )
0 commit comments