Closed ericphanson closed 3 years ago
Thanks for opening an issue; I'm actively digging in pretty deep on this code, so this is a helpful use-case to know about. Unfortunately the fix isn't super easy, but I'm going to try and dig in and get it done pretty soon because I'd like to get a new release out.
Alright, as expected, it's a doozy of a PR, but it turns out the code had more than just this bad assumption, so it all needed a good pass through the refiner's fire to get it more robust. https://github.com/JuliaData/Strapping.jl/pull/13
Cool!
I think I may have run into some of those other issues a month or so ago but didn't end up filing an issue since I didn't know if I was using it right. My use-case then was to serialize simple Julia objects (like structs containing numeric matrices and vectors, and structs containing such structs) for later retrieval in Julia; i.e. basically like JLD2 except I hoped having some control over the serialization via StructTypes would help with robustness and give me the possibility to later deserialize in a very different context if I needed to.
More recently I've been thinking about Strapping as possibly useful for constructing tabular "views" of nested data (within a Julia process, not for serialization); i.e. perhaps the most natural way to read in or construct data is in a nested object, but then it can be easier to analyze that data in a table with groupby's and such. [I put "views" in quotes because it's not always essential that there's no copying involved; sometimes you just want a table].
Here,
results
is aVector{AnalyzeRegistry.Package}
with an entry for every package in General, ie this is the opposite of a MWE, sorry. But a small example (which may not trigger the bug) isOpening the code it looks like Strapping assumes ArrayTypes are nonempty in
The context here is https://github.com/giordano/AnalyzeRegistry.jl where we have a
Package
type to describe information about a Julia package, and we store some pieces information asVector{<:NamedTuple}
row tables, and some of these tables have nested information (e.g. a table with one row per file, with alicenses_found
column which is a vector of software licenses found within that file). In Slack, we discussed unnesting these tables, but it could be useful to use Strapping to deconstruct the entirePackage
into a row in a big table for further analysis.