Skip to content

Commit c1db81c

Browse files
jp-darkihnorton
authored andcommitted
Remove shape check from Domain.__eq__ and fix anon-domain copy
* Remove shape check: The shape is already verifies when checking all dimensions are equal. Because the shape is not always well defined, this was failing on homogenous non-integer/datetime domains. * While testing the above change, an error where the filters were not being copied when adding all anonymous dimensions to a domain was caught and fixed as well.
1 parent 87b0b3d commit c1db81c

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

tiledb/domain.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def clone_dim_with_name(dim, name):
4040
name=name,
4141
domain=dim.domain,
4242
tile=dim.tile,
43+
filters=dim.filters,
4344
dtype=dim.dtype,
45+
var=dim.isvar,
4446
ctx=dim._ctx,
4547
)
4648

@@ -99,20 +101,9 @@ def __eq__(self, other):
99101
"""
100102
if not isinstance(other, Domain):
101103
return False
102-
103-
same_dtype = self._is_homogeneous()
104-
105-
if same_dtype and self.shape != other.shape:
104+
if self.ndim != other.ndim:
106105
return False
107-
108-
ndim = self.ndim
109-
if ndim != other.ndim:
110-
return False
111-
112-
for i in range(ndim):
113-
if self.dim(i) != other.dim(i):
114-
return False
115-
return True
106+
return all(self.dim(index) == other.dim(index) for index in range(self.ndim))
116107

117108
@property
118109
def ndim(self):

0 commit comments

Comments
 (0)