Skip to content

Consider making setproperty copy Vector #1846

@oxinabox

Description

@oxinabox

This is infollow up to other threads trying to remove all the ways users can resize columns out of sync and thus break the DataFrame,

#1844 (comment)

There would be still one hole:

df.a = vector

One option, and I am not completely sold on it, but that I feel is worth considering.
Is that we could make setproperty and single argument setindex,
copy the input.

This would be consistent with the behavior of the constructor as copying the Vectors,

But unlike that there is no easy way to pass in a copycols=false kwarg or a Dataframe! constructor.

So if we were to do that, I suggest we would have a @nocopy macro to bypass this.,
so that

@nocopy df.a = vector

would not copy vector but would dispatch to some alternative nocopy_setcol
where as

df.a = vector

would dispatch to setcol (which would intern dispatch to nocopy_setcol(df, col, copy(vector))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions