Skip to content

Allow initializing table Column from list of objects? #9230

@taldcroft

Description

@taldcroft

As discussed in #9165 (comment), one might consider raising an exception for an input list that ends up as an object array.

From @mhvk:
My sense would be to be a bit less forgiving in this case. E.g., the list may contain quantities with incompatible units or incompatible TimeDelta scales - both of which would be more likely mistakes. My sense would be to force users to create object arrays if they really want them.

(Over at numpy, there has been discussion - but no action - on never automatically creating object arrays; see numpy/numpy#5353)

From @taldcroft:
I think that this is a somewhat significant API change that would need to be done in a graduated way starting with future deprecation warnings or whatnot. I'm pretty sure some of our Chandra code would break, and I bet we aren't the only ones. Silly stuff like below can be handy sometimes:

t['stuff'] = [random_obj1, random_obj2]

Yes, there is a workaround but ... At the very least, that API change should start as a separate issue with some focused discussion. My feeling would be to follow whatever numpy does or does not do on that front.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API changePRs and issues that change an existing API, possibly requiring a deprecation periodquestiontable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions