nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: TileDB-Inc/TileDB-Py
Pull request #2176 (2025-03-13 19:54:43)

Fix URI passed to consolidation
`self.array.uri` would need to be changed to private method `self.array._uri()`. But the attribute is stored to the Py class so use it as is done in logic down on ln 766.

This impacts APIs including tiledb-py, cloud-py and any other API consolidating with specific fragments URIs


Patch:
diff --git a/tiledb/array.py b/tiledb/array.py
index fe773aad..5c695313 100644
--- a/tiledb/array.py
+++ b/tiledb/array.py
@@ -738,7 +738,7 @@ class Array:
                     "passed to `fragment_uris` will be consolidate",
                     DeprecationWarning,
                 )
-            lt.Array._consolidate(self.array.uri, self.ctx, fragment_uris, config)
+            lt.Array._consolidate(self.uri, self.ctx, fragment_uris, config)
             return
         elif timestamp is not None:
             warnings.warn(


Test patch:
diff --git a/tiledb/tests/test_libtiledb.py b/tiledb/tests/test_libtiledb.py
index 7e47ec84..8e0c3d0b 100644
--- a/tiledb/tests/test_libtiledb.py
+++ b/tiledb/tests/test_libtiledb.py
@@ -3323,8 +3323,9 @@ class ConsolidationTest(DiskTestCase):
         tiledb.vacuum(path)
         assert len(tiledb.array_fragments(path)) == 3
 
+    @pytest.mark.parametrize("use_highlevel_method", [True, False])
     @pytest.mark.parametrize("use_timestamps", [True, False])
-    def test_array_consolidate_with_uris(self, use_timestamps):
+    def test_array_consolidate_with_uris(self, use_timestamps, use_highlevel_method):
         dshape = (1, 3)
         num_writes = 10
 
@@ -3350,7 +3351,11 @@ class ConsolidationTest(DiskTestCase):
 
         frag_names = [os.path.basename(f) for f in frags.uri]
 
-        tiledb.consolidate(path, fragment_uris=frag_names[:4])
+        if use_highlevel_method:
+            tiledb.consolidate(path, fragment_uris=frag_names[:4])
+        else:
+            with tiledb.open(path, "w") as A:
+                A.consolidate(fragment_uris=frag_names[:4])
 
         assert len(tiledb.array_fragments(path)) == 7
 
@@ -3362,11 +3367,18 @@ class ConsolidationTest(DiskTestCase):
             ),
         ):
             timestamps = [t[0] for t in tiledb.array_fragments(path).timestamp_range]
-            tiledb.consolidate(
-                path,
-                fragment_uris=frag_names[4:8],
-                timestamp=(timestamps[5], timestamps[6]),
-            )
+            if use_highlevel_method:
+                tiledb.consolidate(
+                    path,
+                    fragment_uris=frag_names[4:8],
+                    timestamp=(timestamps[5], timestamps[6]),
+                )
+            else:
+                with tiledb.open(path, "w") as A:
+                    A.consolidate(
+                        fragment_uris=frag_names[4:8],
+                        timestamp=(timestamps[5], timestamps[6]),
+                    )
 
         assert len(tiledb.array_fragments(path)) == 4