-
Notifications
You must be signed in to change notification settings - Fork 370
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
Merged
bkamins
merged 8 commits into
JuliaData:master
from
bkamins:prepare_dataframerow_broadcasting
Dec 18, 2018
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7194d5c
DataFrameRow: fix iterate, ndims, iterate
bkamins 0a8769e
add eltype to DataFrameRow
bkamins da3671d
additional ndims method
bkamins 75b73ac
replace eltype by EltypeUnknown
bkamins 0b1cf5e
Update src/dataframerow/dataframerow.jl
nalimilan 4cd8d9d
Merge branch 'master' into prepare_dataframerow_broadcasting
bkamins a594aff
Add comment
nalimilan 323f2e7
Merge branch 'master' into prepare_dataframerow_broadcasting
bkamins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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