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

fix for Arrow 2.7 #153

Merged
merged 7 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
Expand All @@ -9,7 +12,7 @@ on:
pull_request:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - Arrow - ${{matrix.arrow}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -21,6 +24,9 @@ jobs:
- ubuntu-latest
arch:
- x64
arrow:
- '2.6'
- 'current'
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -34,10 +40,17 @@ jobs:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-artifacts-${{ hashFiles('**/Project.toml') }}
restore-keys: ${{ runner.os }}-test-artifacts
- name: "install specific Arrow version"
if: ${{ matrix.arrow != 'current' }}
shell: julia --color=yes --project {0}
run: |
using Pkg
Pkg.add(PackageSpec(; name="Arrow", uuid="69666777-d1a9-59fb-9406-91d4454c9d45", version="${{ matrix.arrow }}"))
Pkg.pin("Arrow")
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
with:
file: lcov.info
docs:
Expand Down
10 changes: 9 additions & 1 deletion src/samples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,15 @@ function Arrow.ArrowTypes.JuliaType(::Val{SAMPLES_ARROW_NAME}, ::Type{<:SamplesA
end

function Arrow.ArrowTypes.fromarrow(::Type{<:Samples}, arrow_data, arrow_info, arrow_encoded)
info = Arrow.ArrowTypes.fromarrow(SamplesInfoV2, arrow_info...)
info = Arrow.ArrowTypes.fromarrow(SamplesInfoV2, arrow_info)
data = reshape(arrow_data, (channel_count(info), :))
return Samples(data, info, arrow_encoded)
end

# Legolas v0.5.17 removed the `fromarrow` methods for Legolas rows, preferring the new `fromarrowstruct`
# introduced in Arrow v2.7. We don't want to assume Arrow v2.7 is loaded here, so we will add a method
# so that `fromarrow` continues to work for `SamplesInfoV2`. Additionally, this method is agnostic
# to serialization order of fields (which is the benefit `fromarrowstruct` is designed to bring), so
# we retain correctness. Lastly, as this method's signature is different from the one Legolas pre-v0.5.17
# generates, we avoid method overwriting errors/warnings.
Arrow.ArrowTypes.fromarrow(::Type{SamplesInfoV2}, x::NamedTuple) = SamplesInfoV2(x)
Loading