astropy / astropy/asdf-astropy

Column without a name produces an invalid serialization

Open
#314 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
19
Forks
22
Avg merge
6h 1m
Merged PRs (30d)
1

Description

```python
import asdf
import asdf.table
asdf.dumps({"c": astropy.table.Column(data=[1, 2])})
```
produces a ValidationError:
```
ValidationError: None is not of type 'string'

Failed validating 'type' in schema['properties']['name']:
{'description': 'The name of the column. Each name in a\n'
'[table](http://stsci.edu/schemas/asdf/table/table-1.2.0) '
'must be\n'
'unique.\n',
'pattern': '[A-Za-z_][A-Za-z0-9_]*',
'type': 'string'}

On instance['name']:
None
```

I propose that we introduce a new astropy column tag/schema and stop writing files with the core column tag/schema (but continue to read them).

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with astropy.table.Column(data=[1, 2]) and asdf.dumps. Trace how the core column tag/schema handles a column whose name is None, then review the proposed astropy column tag/schema direction. Done means unnamed columns serialize validly while existing files using the core column tag/schema remain readable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.