Skip to content

Implement mechanism for copying mixin columns without copying data #9009

Closed

Description

@taldcroft

Currently there is no generic mechanism for making a "light" reference copy of mixin columns, i.e. a new object with new meta but with the same data. In the case of making a copy with copy_data=False, Table now uses literally the original object, with ensuing problems:

In [22]: t1 = QTable([[1] * u.m, ['x']])
In [23]: t1['col0'].info.description = 'quant'
In [24]: t1['col1'].info.description = 'column'

In [25]: t2 = t1.copy(copy_data=False)
In [26]: t2['col0'].info.description = 'CHANGED'
In [27]: t2['col1'].info.description = 'CHANGED'

# Original column meta is impacted!
In [28]: t1['col0'].info.description
Out[28]: 'CHANGED'

In [29]: t1['col1'].info.description
Out[29]: 'column'

This needs to be fixed, e.g. for #8077 to work properly.

Activity

  1. self-assigned this
    on Jul 17, 2019
  2. added this to the v4.0 milestone on Jul 18, 2019
  3. taldcroft commented on Oct 22, 2019

    @taldcroft
    MemberAuthor

    Note: with 9009 then do go back to #8077 and improve the implementation to not make any copies!

  4. removed this from the v4.0 milestone on Nov 14, 2019
  5. added
    Close?Tell stale bot that this issue/PR is stale
    and removed on Jun 3, 2026
  6. astrofrog commented on Jun 3, 2026

    @astrofrog
    Member

    @taldcroft - looks like this was fixed in the meantime:

    In [8]: t1 = QTable([[1] * u.m, ['x']])
    
    In [9]: t1['col0'].info.description = 'quant'
    
    In [10]: t1['col1'].info.description = 'column'
    
    In [11]: t2 = t1.copy(copy_data=False)
    
    In [12]: t2['col0'].info.description = 'CHANGED'
    
    In [13]: t2['col1'].info.description = 'CHANGED'
    
    In [14]: t1['col0'].info.description
    Out[14]: 'quant'
    
    In [15]: t1['col1'].info.description
    Out[15]: 'column'

    safe to close?

  7. taldcroft commented on Jun 3, 2026

    @taldcroft
    MemberAuthor

    Yes, safe to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugClose?Tell stale bot that this issue/PR is staletable

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions