diff --git a/astropy/table/table.py b/astropy/table/table.py index 5afe2127a379..88830f5a2f43 100644 --- a/astropy/table/table.py +++ b/astropy/table/table.py @@ -1239,13 +1239,6 @@ def _convert_data_to_col(self, data, copy=True, default_name=None, dtype=None, n f'{fully_qualified_name} ' 'did not return a valid mixin column') - # Structured ndarray gets viewed as a mixin unless already a valid - # mixin class - if (not isinstance(data, Column) and not data_is_mixin - and isinstance(data, np.ndarray) and len(data.dtype) > 1): - data = data.view(NdarrayMixin) - data_is_mixin = True - # Get the final column name using precedence. Some objects may not # have an info attribute. Also avoid creating info as a side effect. if not name: diff --git a/astropy/table/tests/test_mixin.py b/astropy/table/tests/test_mixin.py index 2fdcd20d8fdf..e0c603555100 100644 --- a/astropy/table/tests/test_mixin.py +++ b/astropy/table/tests/test_mixin.py @@ -698,11 +698,8 @@ def test_skycoord_representation(): def test_ndarray_mixin(): - """ - Test directly adding a plain structured array into a table instead of the - view as an NdarrayMixin. Once added as an NdarrayMixin then all the previous - tests apply. - """ + """Structured ndarrays become plain Columns unless explicitly viewed.""" + a = np.array([(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')], dtype=' 0) return(*status); @@ -1885,24 +1885,24 @@ int ffiter(int n_cols, { stringptr = cols[jj].array; dataptr = stringptr + 1; - nullptr = *stringptr; + null_ptr = *stringptr; nbytes = 2; } else { dataptr = (char *) cols[jj].array + col[jj].nullsize; - nullptr = (char *) cols[jj].array; + null_ptr = (char *) cols[jj].array; nbytes = col[jj].nullsize; } - if (memcmp(nullptr, &zeros, nbytes) ) + if (memcmp(null_ptr, &zeros, nbytes) ) { /* null value flag not zero; must check for and write nulls */ if (hdutype == IMAGE_HDU) { if (ffppn(cols[jj].fptr, cols[jj].datatype, felement, cols[jj].repeat * ntodo, dataptr, - nullptr, &tstatus) > 0) + null_ptr, &tstatus) > 0) break; } else @@ -1917,7 +1917,7 @@ int ffiter(int n_cols, if (ffpcn(cols[jj].fptr, cols[jj].datatype, cols[jj].colnum, frow, felement, cols[jj].repeat * ntodo, dataptr, - nullptr, &tstatus) > 0) + null_ptr, &tstatus) > 0) break; } } diff --git a/pyproject.toml b/pyproject.toml index 4e84dd196bfc..8dd02b108c82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = ["setuptools", "setuptools_scm>=6.2", "wheel", - "cython==0.29.22", + "cython>=0.29.37,<0.30", "oldest-supported-numpy", "extension-helpers"] build-backend = 'setuptools.build_meta'