diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ee45ffa9..5628e14a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,4 +1,7 @@ name: CI +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true on: push: branches: @@ -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 @@ -21,6 +24,9 @@ jobs: - ubuntu-latest arch: - x64 + arrow: + - '2.6' + - 'current' steps: - uses: actions/checkout@v2 with: @@ -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: diff --git a/src/samples.jl b/src/samples.jl index f5fe8027..05ba5781 100644 --- a/src/samples.jl +++ b/src/samples.jl @@ -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)