-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify push!
, append!
and vcat
implementation.
#2032
Comments
OK - so I am closing all other issues related to this. Can you please summarize your proposal here, so that it is easy to keep track of it? Thank you! As noted earlier - the changes will be non breaking, nevertheless, if we can make it - I think it would be great to have them in 1.0 release. |
Summary done :D |
I think you need to make a distinction between Also |
And as noted on Slack: we need to make |
For more than two arguments case currenr implementation just In the current type promotion style there is only reallocation if the promoted type is different from the allocated vectors. But that is necessary anyway to hold the invariant of being capable of storing tB (if |
Merging #2152 will cover this issue in the range expected for 1.0 release. |
I intend to rewrite the internal code that does the merging of a DataFrame with another DataFrame, DataFrameRow, NamedTuple or AbstractDict.
Idea is as follows:
promotetype
cols
column merging algorithmspush!
,append!
andvcat
are just front end redirectors which call into the following functionsinfersignature(signatureA, signatureB; cols, promotetype)
__merge!(df, others..., newsignature)
Details:
infersignature(signatureA::Signature, signatureB::Signature; cols::Symbol, promotetype::Type)
this infers the signature of the resulting DataFrame from the provided signatures, the
cols
keywordand the
promotetype
according to the following rules:cols
keyword, including::orderequal
: names and order must be the same, error otherwise:setequal
: names can appear in any order but must be present in both signatures, error otherwise:subset
: the names of A must be a strict subset of (or equal to) the names of B, error otherwise:superset
: the names of A must be a strict superset of (or equal to) the names of B, error otherwise:left
: take the names of A:right
: take the names of B:intersect
: take the names that are present in both signatures:union
: take the names that are present in at least one signaturepromotetype
keyword. It'll roughly works like this:__merge!(df::DataFrame, others..., newsignature::Signature)
this merges all arguments into the first argument, resulting in the signature provided.
Rules:
df
whose type fits the corresponding requested type is reused and resized (hence in-place). Otherwise a new column is allocated and filled.Ref: #1982, #1991
The text was updated successfully, but these errors were encountered: