astropy / astropy/astropy

Consider further tweak to Table._convert_data_to_col

Open
#8,943 0 comments 0 reactions 0 assignees View on GitHub
table
Dominant language
Python
Stars
5.3k
Forks
2.2k
Avg merge
1d 18h
Merged PRs (30d)
74

Description

See https://github.com/astropy/astropy/pull/8933/files#r299094991 and the following code snip. Question is whether this might go into `Table._convert_data_to_col` instead of just `add_column`.
```
# If value doesn't have a dtype and won't be added as a mixin then
# convert to a numpy array.
if not hasattr(col, 'dtype') and not self._is_mixin_for_table(col):
col = np.asarray(col)
```
This same preprocessing is not done before the other 2 places this is called (`_init_from_list` and `replace_column`). Not clear right now if that is a mistake or necessary.

Contributor guide

Open the contributing guide

Research direction

Start by reading the referenced PR discussion and the Table._convert_data_to_col entry point. Compare how the shown preprocessing relates to add_column, _init_from_list, and replace_column, and determine whether the differing behavior is intentional. Done means the desired handling across these callers is decided and documented by the appropriate implementation and validation changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.