Skip to content
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

Use TableTraits.isiterabletable in rows and columns #89

Merged
merged 1 commit into from
May 4, 2019

Conversation

nalimilan
Copy link
Member

@nalimilan nalimilan commented May 2, 2019

Otherwise we misdetect some table types which do not define Base.iterable, like ExcelFile.
Add a new test for this pattern.

Fixes queryverse/ExcelFiles.jl#33, which appeared after #84.

CI fails due to version incompatibilities, not sure why (EDIT: that's #88).

Otherwise we misdetect some table types which do not define `Base.iterable`,
like `ExcelFile`.
Add a new test for this pattern.
@quinnj
Copy link
Member

quinnj commented May 4, 2019

Thanks!

@quinnj quinnj merged commit 5a8e971 into master May 4, 2019
@quinnj quinnj deleted the nl/isiterabletable branch May 4, 2019 04:18
@@ -58,7 +58,7 @@ function rows(x::T) where {T}
if columnaccess(T)
cols = columns(x)
return RowIterator(cols, rowcount(cols))
elseif Base.isiterable(T)
elseif TableTraits.isiterabletable(x) === true || Base.isiterable(T)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could further simplify this: TableTraits.isiterabletable(x) will return true if Base.isiterable(T) is true, so we don't need that second test. Also, I think we also want to take this branch if TableTraits.isiterabletable(x)===missing, right? So I think the test should probably read elseif TableTraits.isiterabletable(x) !== false.

But having said this, this PR is clearly fixing a bug already, so thanks for opening it!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're clearly the expert here, so feel free to open a PR to improve this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do once I'm done with my current travel stint. @quinnj could you tag a bug fix release that includes this PR soon? Tables v0.2.0 broke the entire file IO story in Queryverse, and this PR fixes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFrame(load("file.xlsx", "sheetname")) not working
3 participants