arquero icon indicating copy to clipboard operation
arquero copied to clipboard

question: rename silently gets rid of column, is this expected behavior?

Open dan-reznik opened this issue 3 years ago • 2 comments

Start w a simple 2-col arquero table:

my_tab=aq.table({col1:[1,2,3],col2:[4,5,6]})

then do the following rename:

my_tab.rename({col1:'col2'})

the above replaces col1 by the contents of col2, so the rename operation will effectively delete a column. this could be undesirable from a logical standpoint.

perhaps a warning should be issued so this at least is not silent.

dan-reznik avatar Jun 04 '21 21:06 dan-reznik

Assigning to an existing column overwrites it by design. At minimum we should double check to ensure this is clearly stated in the documentation. Alternatively, we could consider throwing an error if we want to enforce that no deletions may occur.

jheer avatar Jun 04 '21 22:06 jheer

Thanks for your prompt response! Either way would be better than silent deletion.

On Fri, Jun 4, 2021 at 7:36 PM Jeffrey Heer @.***> wrote:

Assigning to an existing column overwrites it by design. At minimum we should double check to ensure this is clearly stated in the documentation. Alternatively, we could consider throwing an error if we want to enforce that no deletions may occur.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/uwdata/arquero/issues/202#issuecomment-855059256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD32VFS4X3PYPCFS76LXD3TTRFIPDANCNFSM46DS3QVQ .

dan-reznik avatar Jun 04 '21 22:06 dan-reznik