Skip to content

Commit eb3ac6d

Browse files
committed
Correct subarray method to respect view_attr for dense arrays
1 parent 610fd32 commit eb3ac6d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tiledb/dense_array.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ def __getitem__(self, selection):
7777
7878
"""
7979
if self.view_attr:
80-
result = self.subarray(selection, attrs=(self.view_attr,))
81-
return result[self.view_attr]
80+
return self.subarray(selection)
8281

8382
result = self.subarray(selection)
8483
for i in range(self.schema.nattr):
@@ -269,6 +268,8 @@ def subarray(self, selection, attrs=None, cond=None, coords=False, order=None):
269268
attr = self.schema.attr(0)
270269
if attr.isanon:
271270
return out[attr._internal_name]
271+
if self.view_attr:
272+
return out[self.view_attr]
272273
return out
273274

274275
def _read_dense_subarray(

0 commit comments

Comments
 (0)