Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
DataFrameRow: fix iterate, ndims, iterate #1637
DataFrameRow: fix iterate, ndims, iterate #1637
Changes from 3 commits
7194d5c
0a8769e
da3671d
75b73ac
0b1cf5e
4cd8d9d
a594aff
323f2e7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also test the type? When you say the eltype is
Any
, I guess this applies only to heterogeneous column types, right? It would be useful to cover that case too.(BTW,
Vector
doesn't promote AFAICT, as it uses a comprehension.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix it and test it. Actually it should be narrowest type (as in comprehensions).
What is problematic (and confused me) that in
Matrix(df)
we useT = reduce(promote_type, eltypes(df))
and probably we should useT = reduce(typejoin, eltypes(df))
. Should I fix it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added
eltype
forDataFrameRow
and now it will be as you wanted (and it is OK to add it given the interface specification).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See discussion at #1641. Maybe we should use promotion here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed 😄 in #1641, if someone wants a promotion to
T
one should useVector{T}(dfr)
in my opinion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should we use
promote_type
here too for consistency with #1641?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that this was exactly the point we wanted to have a difference here.
Essentially this is the same as:
But I am not too attached to what we have now. But it we want to do the promotion here we should define
eltype
(and this is exactly what I have removed some 2 commits ago 😄).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should keep
collect
as-is for consistency with tuples, but haveconvert
use promotion to be consistent with data frames?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what we do. But it is implemented in #1640.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, too many PRs... :-p