AlgebraicJulia / AlgebraicJulia/ACSets.jl

Avoid converting Dict to OrderedDict when loading from JSON3

オープン
#188 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
36
フォーク
11
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi,
this package is currently the only package that depends on DataStructures that breaks with OrderedCollections v2.0
see https://github.com/JuliaCollections/DataStructures.jl/pull/973#issuecomment-4836123874
for what breaks.

But basically this test:
https://github.com/AlgebraicJulia/ACSets.jl/blob/aac441e1bf6e9813ba6da51a97d5d3738c3e549c/test/intertypes/InterTypes.jl#L103

eventually results in
StructTypes.jl calling to construct: an `Object` with a `Dict`, which then result in a call to `convert(OrderDict ::Dict)` here. https://github.com/AlgebraicJulia/ACSets.jl/blob/aac441e1bf6e9813ba6da51a97d5d3738c3e549c/src/intertypes/InterTypes.jl#L237

I have looked and I have not managed to workout why that is happening.
You can likely debug by running julia with depwarn set to error.

`convert(OrderDict ::Dict)` has been deprecated in since Jan 2017 (that's before the Julia 1.0 release)
https://github.com/JuliaCollections/OrderedCollections.jl/commit/bea403157497de7821d824fe44d03f7aff38743e

The **short term fix,** if we were to release a new version of DataStructures that allows both OrderedCollections 1.0 and 2.0 which we are seriously considering,
is for you to add a dependancy on OrderedCollections directly and bound the compant on that to v1.0

The **ideal fix** would be to workout why that convert is happening in the first place. and stop that
Probably right now, if things actually need to be kept in order then actually that is bugged, since the `Dict` getting constructed is losing all your order.
I went looking, and I couldn't see where the `Dict` was actually coming from.
JSON3 shouldn't normally make `Dict`s under the hook, they have their own Dict type that i think preserves order.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。