Repository navigation
Conversation
|
@cdeil - does this extend to other meta-data attributes, such as |
Yes ... same issue for >>> table['a'] = Column([1, 2, 3], description='original', unit='m')
>>> table['a']
<Column name='a' unit=None format=None description='original'> |
|
Yes, looks like a bug to me. |
|
I've assigned this to @luzuku |
|
I've confirmed that this bug is still present with Astropy master (2a96500). @luzuku was assigned in 2014. @astrofrog - Please remove that. I want to help get this fixed, but I've never looked at the Table / Column codebase. |
|
Fixing this bug is obviously the right thing, but there is now a workaround: |
|
@cdeil - I probably don't have time to drive this home, but I think this works: |
|
@taldcroft - Thanks! As a first step, I'll attach a regression test and the fix you propose to this issue. |
|
I've attached a commit here that applies the patch posted by @taldcroft above, and adds a regression test. I locally confirmed that all the asserts in the test fail before applying the patch. @taldcroft - Is it useful to put in this fix into 1.3 in it's current form? The TODO comment you left suggests this is not a full fix, and mixin columns will still fail? |
|
@cdeil - now I'm starting to consider whether it would be possible / good to reverse my earlier opinion and make |
|
Part of the driver is thinking about mixin columns and realizing that really handling that case assuming inplace replacement is just a bit ugly. |
|
@taldcroft - I agree, and if people really want in-place replacement of values for performance, they can do |
|
@taldcroft @astrofrog - I don't have an opinion here what should happen exactly, except that it would be nice to get the bug / pitfall fixed. Let me know if I can be of any help, or just make a new PR or push commits here. |
|
This issue was fixed by @taldcroft in #5556 . Just leaving a comment here with some explanations, in case I or someone else comes across this issue in the future ... With >>> from astropy.table import Table, Column
>>> table = Table()
>>> table['a'] = Column([1, 2, 3], unit='m', description='original')
>>> table['a'] = Column([4, 5, 6], unit='s', description='updated')
>>> table
<Table length=3>
a
s
int64
-----
4
5
6The new potential gotcha (or at least changed behaviour) is that the following used to do an in-place update of the values and keep other column attributes like >>> table['a'] = [7, 8, 9]
>>> table['a']
<Column name='a' dtype='int64' length=3>
7
8
9@taldcroft explained this in #5556 in the changelog entry and the docs. |
I would have expected the column
description='updated'to be stored in thetable['a']column in this example:@taldcroft Is this a bug?