@@ -865,12 +865,70 @@ def generate_snapshot(
865865 "refs" : {"test" : {"snapshot-id" : 3051729675574597004 , "type" : "tag" , "max-ref-age-ms" : 10000000 }},
866866}
867867
868+ TABLE_METADATA_V2_WITH_FIXED_AND_DECIMAL_TYPES = {
869+ "format-version" : 2 ,
870+ "table-uuid" : "9c12d441-03fe-4693-9a96-a0705ddf69c1" ,
871+ "location" : "s3://bucket/test/location" ,
872+ "last-sequence-number" : 34 ,
873+ "last-updated-ms" : 1602638573590 ,
874+ "last-column-id" : 7 ,
875+ "current-schema-id" : 1 ,
876+ "schemas" : [
877+ {
878+ "type" : "struct" ,
879+ "schema-id" : 1 ,
880+ "identifier-field-ids" : [1 ],
881+ "fields" : [
882+ {"id" : 1 , "name" : "x" , "required" : True , "type" : "long" },
883+ {"id" : 4 , "name" : "a" , "required" : True , "type" : "decimal(16, 2)" },
884+ {"id" : 5 , "name" : "b" , "required" : True , "type" : "decimal(16, 8)" },
885+ {"id" : 6 , "name" : "c" , "required" : True , "type" : "fixed[16]" },
886+ {"id" : 7 , "name" : "d" , "required" : True , "type" : "fixed[18]" },
887+ ],
888+ }
889+ ],
890+ "default-spec-id" : 0 ,
891+ "partition-specs" : [{"spec-id" : 0 , "fields" : [{"name" : "x" , "transform" : "identity" , "source-id" : 1 , "field-id" : 1000 }]}],
892+ "last-partition-id" : 1000 ,
893+ "properties" : {"read.split.target.size" : "134217728" },
894+ "current-snapshot-id" : 3055729675574597004 ,
895+ "snapshots" : [
896+ {
897+ "snapshot-id" : 3051729675574597004 ,
898+ "timestamp-ms" : 1515100955770 ,
899+ "sequence-number" : 0 ,
900+ "summary" : {"operation" : "append" },
901+ "manifest-list" : "s3://a/b/1.avro" ,
902+ },
903+ {
904+ "snapshot-id" : 3055729675574597004 ,
905+ "parent-snapshot-id" : 3051729675574597004 ,
906+ "timestamp-ms" : 1555100955770 ,
907+ "sequence-number" : 1 ,
908+ "summary" : {"operation" : "append" },
909+ "manifest-list" : "s3://a/b/2.avro" ,
910+ "schema-id" : 1 ,
911+ },
912+ ],
913+ "snapshot-log" : [
914+ {"snapshot-id" : 3051729675574597004 , "timestamp-ms" : 1515100955770 },
915+ {"snapshot-id" : 3055729675574597004 , "timestamp-ms" : 1555100955770 },
916+ ],
917+ "metadata-log" : [{"metadata-file" : "s3://bucket/.../v1.json" , "timestamp-ms" : 1515100 }],
918+ "refs" : {"test" : {"snapshot-id" : 3051729675574597004 , "type" : "tag" , "max-ref-age-ms" : 10000000 }},
919+ }
920+
868921
869922@pytest .fixture
870923def example_table_metadata_v2 () -> Dict [str , Any ]:
871924 return EXAMPLE_TABLE_METADATA_V2
872925
873926
927+ @pytest .fixture
928+ def table_metadata_v2_with_fixed_and_decimal_types () -> Dict [str , Any ]:
929+ return TABLE_METADATA_V2_WITH_FIXED_AND_DECIMAL_TYPES
930+
931+
874932@pytest .fixture (scope = "session" )
875933def metadata_location (tmp_path_factory : pytest .TempPathFactory ) -> str :
876934 from pyiceberg .io .pyarrow import PyArrowFileIO
@@ -2064,6 +2122,22 @@ def table_v2(example_table_metadata_v2: Dict[str, Any]) -> Table:
20642122 )
20652123
20662124
2125+ @pytest .fixture
2126+ def table_v2_with_fixed_and_decimal_types (
2127+ table_metadata_v2_with_fixed_and_decimal_types : Dict [str , Any ],
2128+ ) -> Table :
2129+ table_metadata = TableMetadataV2 (
2130+ ** table_metadata_v2_with_fixed_and_decimal_types ,
2131+ )
2132+ return Table (
2133+ identifier = ("database" , "table" ),
2134+ metadata = table_metadata ,
2135+ metadata_location = f"{ table_metadata .location } /uuid.metadata.json" ,
2136+ io = load_file_io (),
2137+ catalog = NoopCatalog ("NoopCatalog" ),
2138+ )
2139+
2140+
20672141@pytest .fixture
20682142def table_v2_with_extensive_snapshots (example_table_metadata_v2_with_extensive_snapshots : Dict [str , Any ]) -> Table :
20692143 table_metadata = TableMetadataV2 (** example_table_metadata_v2_with_extensive_snapshots )
0 commit comments