@@ -412,12 +412,20 @@ def read_source_metadata(
412412 if source_type == "TILEDB_ARRAY" :
413413 schema = tiledb .ArraySchema .load (source_uri )
414414 size = np .int64 (schema .domain .dim (1 ).domain [1 ]) + 1
415- dimensions = np .int64 (schema .domain .dim (0 ).domain [1 ]) + 1
415+ # In the case that current domain is non-empty, we need to consider it
416+ if hasattr (schema , "current_domain" ) and not schema .current_domain .is_empty :
417+ dimensions = np .int64 (schema .current_domain .dim (0 ).domain [1 ]) + 1
418+ else :
419+ dimensions = np .int64 (schema .domain .dim (0 ).domain [1 ]) + 1
416420 return size , dimensions , schema .attr (0 ).dtype
417421 if source_type == "TILEDB_SPARSE_ARRAY" :
418422 schema = tiledb .ArraySchema .load (source_uri )
419423 size = np .int64 (schema .domain .dim (0 ).domain [1 ]) + 1
420- dimensions = np .int64 (schema .domain .dim (1 ).domain [1 ]) + 1
424+ # In the case that current domain is non-empty, we need to consider it
425+ if hasattr (schema , "current_domain" ) and not schema .current_domain .is_empty :
426+ dimensions = np .int64 (schema .current_domain .dim (1 ).domain [1 ]) + 1
427+ else :
428+ dimensions = np .int64 (schema .domain .dim (1 ).domain [1 ]) + 1
421429 return size , dimensions , schema .attr (0 ).dtype
422430 if source_type == "TILEDB_PARTITIONED_ARRAY" :
423431 with tiledb .open (source_uri , "r" , config = config ) as source_array :
0 commit comments