beacon-biosignals / LegolasFlux.jl

Save Flux model weights in Legolas-powered Arrow tables
MIT License
6 stars 1 forks source link

Fix Arrow deserialization for `FlatArray` #29

Closed ararslan closed 11 months ago

ararslan commented 11 months ago

Tests currently fail with the latest compatible versions of this package's dependencies because deserializing a FlatArray from Arrow ends up calling a FlatArray constructor method that doesn't exist: FlatArray(vec, size). What it should actually call is the inner constructor, FlatArray{T}(vec, size). To fix this, we can define a method for fromarrow from ArrowTypes to simply call the inner constructor. An analogous change is not needed for Weights because the method that fromarrow calls by default does exist in that case.

Note that no new tests were added. This is because the current tests actually cover this case.

Originally encountered by then pair debugged with @patinoam.

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (27acd1b) 94.11% compared to head (25ca360) 94.33%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #29 +/- ## ========================================== + Coverage 94.11% 94.33% +0.22% ========================================== Files 2 2 Lines 51 53 +2 ========================================== + Hits 48 50 +2 Misses 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ararslan commented 11 months ago

any idea which that might be?

Based on the error, my only guess would be ArrowTypes, which this package uses like a submodule of Arrow rather than as a distinct dependency. That means we effectively inherit Arrow's compat bound on ArrowTypes.

ericphanson commented 11 months ago

I believe it was Arrow 2.6. A lot of our internal packages that use LegolasFlux compat bounded to 2.5 to avoid this and other similar issues (but I guess we did not file an issue here or anything 😅).