Skip to content

Commit ff6039e

Browse files
committed
Put in workaround for issue #1471
1 parent 1c34029 commit ff6039e

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎astropy/table/groups.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def aggregate(self, func):
127127
.format(par_col.name))
128128

129129
out = par_col.__class__(data=vals, name=par_col.name, description=par_col.description,
130-
unit=par_col.unit, format=par_col.format, meta=par_col.meta)
130+
unit=par_col.unit, format=par_col.format, meta=par_col.meta)
131131
return out
132132

133133

@@ -166,7 +166,14 @@ def aggregate(self, func):
166166
for col in parent_table.columns.values():
167167
# For key columns just pick off first in each group since they are identical
168168
if col.name in self.group_keys:
169-
new_col = col.take(i0s)
169+
# Should just be new_col = col.take(i0s), but there is a bug in
170+
# MaskedColumn finalize:
171+
# >>> c = MaskedColumn(data=[1,2], name='a', description='a')
172+
# >>> print c[1:2].description
173+
# None
174+
new_col = col.__class__(data=col.take(i0s), name=col.name,
175+
description=col.description,
176+
unit=col.unit, format=col.format, meta=col.meta)
170177
else:
171178
try:
172179
new_col = col.groups.aggregate(func)

0 commit comments

Comments
 (0)