File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1670,7 +1670,7 @@ def init(
1670
1670
root = zarr .group (store = store )
1671
1671
1672
1672
for column in self .schema .columns .values ():
1673
- self .init_array (root , column )
1673
+ self .init_array (root , column , partitions [ - 1 ]. stop_index )
1674
1674
1675
1675
logger .info ("Writing WIP metadata" )
1676
1676
with open (self .wip_path / "metadata.json" , "w" ) as f :
@@ -1718,13 +1718,16 @@ def encode_filter_id(self, root):
1718
1718
)
1719
1719
array .attrs ["_ARRAY_DIMENSIONS" ] = ["filters" ]
1720
1720
1721
- def init_array (self , root , variable ):
1721
+ def init_array (self , root , variable , variants_dim_size ):
1722
1722
object_codec = None
1723
1723
if variable .dtype == "O" :
1724
1724
object_codec = numcodecs .VLenUTF8 ()
1725
+ shape = list (variable .shape )
1726
+ # Truncate the variants dimension is max_variant_chunks was specified
1727
+ shape [0 ] = variants_dim_size
1725
1728
a = root .empty (
1726
1729
variable .name ,
1727
- shape = variable . shape ,
1730
+ shape = shape ,
1728
1731
chunks = variable .chunks ,
1729
1732
dtype = variable .dtype ,
1730
1733
compressor = numcodecs .get_codec (variable .compressor ),
You can’t perform that action at this time.
0 commit comments