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

Return SubArrays when possible for arrow list types #446

Merged
merged 3 commits into from
Jun 2, 2023
Merged

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Jun 1, 2023

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2023

Codecov Report

Merging #446 (d944dcb) into main (d1b5326) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #446      +/-   ##
==========================================
+ Coverage   87.46%   87.49%   +0.03%     
==========================================
  Files          26       26              
  Lines        3263     3271       +8     
==========================================
+ Hits         2854     2862       +8     
  Misses        409      409              
Impacted Files Coverage Δ
src/append.jl 92.04% <100.00%> (+0.37%) ⬆️
src/table.jl 92.49% <100.00%> (+0.06%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

(t1 === t2) || (return false)
tt1 = Base.nonmissingtype(t1)
tt2 = Base.nonmissingtype(t2)
if t1 == t2 || (tt1 <: AbstractVector && tt2 <: AbstractVector && eltype(tt1) == eltype(tt2))
Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed to loosen what we consider "equivalent schemas"; i.e. a column w/ eltype Vector{Int} is now "equal" to SubArray{Int, 1, ...}

@quinnj
Copy link
Member Author

quinnj commented Jun 2, 2023

@baumgold, this is ready to review if you have a moment.

Copy link
Member

@baumgold baumgold left a comment

Choose a reason for hiding this comment

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

This looks good to me, just some small comments. Thank you for this - it's much cleaner and simpler than what I was working on in #405.

(t1 === t2) || (return false)
tt1 = Base.nonmissingtype(t1)
tt2 = Base.nonmissingtype(t2)
if t1 == t2 || (tt1 <: AbstractVector && tt2 <: AbstractVector && eltype(tt1) == eltype(tt2))
Copy link
Member

Choose a reason for hiding this comment

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

This looks good to me. Small nit-pick... small simplification without the continue:

t1 != t2 && (tt1 <: AbstractVector && tt2 <: AbstractVector && eltype(tt1) != eltype(tt2)) && return false

src/table.jl Outdated Show resolved Hide resolved
@quinnj quinnj merged commit e295928 into main Jun 2, 2023
@quinnj quinnj deleted the jq-subarray-return branch June 2, 2023 17:11
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.

3 participants