-
Notifications
You must be signed in to change notification settings - Fork 59
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
reconsidering the current type registration/serialization mechanism (and its internal usage) #88
Comments
(The workaround is to just call |
The UUID case is now fixed (defined by default in Arrow) and we've updated the docs to mention the need to call |
@quinnj what's the motivation behind https://github.com/JuliaData/Arrow.jl/blob/3ab2b18829c1656198a85759360389b6bbb22ab3/src/arraytypes/struct.jl#L86? Is it just to give the "convenience behavior" listed in the OP or is there a deeper reason? If it's just the former, I wonder if it's better just to remove it...I ran into another related issue just now. I'm essentially implementing the following (which is also why I needed #150): struct Foo ... end
struct _FooArrow ... end
Foo(::_FooArrow) = ...
Arrow.ArrowTypes.registertype!(Foo, _FooArrow)
Arrow.ArrowTypes.arrowconvert(::Type{_FooArrow}, f::Foo) = ... the above in theory would allow me to have full control over Arrow <-> Julia conversion for my The problem is that Arrow.jl is automatically calling Even if we can't get rid of it in general, would it be possible to gate this behavior behind a flag passed to |
Just to add another reason in favor of removing it, mutating the global registration dict at write-time seems like it could be an issue for concurrent writing from different threads (ref #90 (comment) for other thread safety issues). Whereas the user could be sure to always manually register outside the threaded region of code. |
Yeah, these are good points for removing the auto registering. The main reason for having it was convenience. |
@jrevels , can you explain your use-case/example a bit more? What I dont' quite follow is how |
Hold up, don't mind me. I'm digging back through all the code and in the structs.jl file we know how to serialize a |
Wait, backsies again. So the problem with not autoregistering, is that without
|
Ah, but for me this is the desired behavior :) I want it to deserialize as NamedTuple unless I, the caller, tell it explicitly not to. Right now it feels like Arrow.jl is making the decision for me, and it's making the wrong one (AFAICT). Reopening this issue as it seems like the discussion may lead to some action items :) |
ref beacon-biosignals/Onda.jl#68 for a motivating example. my thoughts are very rough/not super well-considered yet, but off the top of my head, here are my big "wants" (some of these might already be possible w/ existing behavior):
|
preserving some relevant convo from the Julia Slack (https://julialang.slack.com/archives/C674VR0HH/p1615846377461400?thread_ts=1615681758.430500&cid=C674VR0HH) |
Closing now that #156 is merged/tagged |
E.g.
In a new session:
I believe this is due to the write-time registration of types at
https://github.com/JuliaData/Arrow.jl/blob/3ab2b18829c1656198a85759360389b6bbb22ab3/src/arraytypes/struct.jl#L86
The text was updated successfully, but these errors were encountered: