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

Add gather macro #213

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

TonyLianLong
Copy link
Contributor

Add gather macro which uses gather function in QueryOperators.jl.

@codecov-io
Copy link

codecov-io commented Nov 6, 2018

Codecov Report

Merging #213 into master will decrease coverage by 7.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #213      +/-   ##
==========================================
- Coverage   90.02%   82.87%   -7.16%     
==========================================
  Files           5        5              
  Lines         441      397      -44     
==========================================
- Hits          397      329      -68     
- Misses         44       68      +24
Impacted Files Coverage Δ
src/standalone_query_macros.jl 100% <ø> (ø) ⬆️
src/Query.jl 76.92% <ø> (-1.65%) ⬇️
src/query_translation.jl 80.89% <0%> (-8.66%) ⬇️
src/table_query_macros.jl 97.05% <0%> (+4.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc5914e...452e48f. Read the comment docs.

@TonyLianLong
Copy link
Contributor Author

TonyLianLong commented Nov 28, 2018

What to do next:

I think the next step would be to add a method to Base.eltype for the EnumerableGather type.

You can look up how that is implemented for some of the other enumerable types

It should return the type of the elements that are being iterated by EnumerableGather (so some sort of NamedTuple).

As soon as we add that method, we will get two things: 1) nice table like printing of the result, and 2) the ability to pipe things into e.g. a DataFrame

Right now we don't have a method for Base.eltype, so it is falling back to the generic method, which will just return Any

That is technically correct (because everything is a subtype of Any)

But downstream consumers of the iterator won't know that this is actually iterating named tuples, and therefor won't interpret the result as a table

By adding a method to eltype, we can change that.

The trick is to have at least one type parameter in EnumerableGather that can hold the eltype, and then make sure you set that accordingly in the gather function

@davidanthoff
Copy link
Member

Things still to do:

  • Tag a QueryOperators release and bump its version in REQUIRE
  • Write docs
  • Add it to NEWS

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

Successfully merging this pull request may close these issues.

None yet

3 participants