-
Notifications
You must be signed in to change notification settings - Fork 817
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
Remove indexmap
dependency
#1882
Comments
I'm in favor of removing it. I think it still comes in as a transitive dependency via the We are also pinned to an old version because of tkaitchuck/aHash#95 so removing it might break that dependency cycle. |
A new release has been cut which updates some dependencies, including hashbrown indexmap-rs/indexmap#231 |
@jhorstmann notes he may try this issue -- more context on https://lists.apache.org/thread/qxt3qv5pv8tfy4cj6jgp8gl90k3rr562 / #1929 |
@alamb there's indeed a coverage gap. If I change the column "a" to "f", and run the tests, the schema order changes, with the fields ordered alphabetically with From what I can see, this change should be safe, as users should be looking up columns in a record batch by schema index, and not the column order of the input JSON data. It would be hard to see someone relying on some column order for JSON though, because what if the first record doesn't have some field ( The failures are because we're testing field orders, and changing the input JSON reveals the difference. The test let a = schema.column_with_name("a").unwrap();
# check that the column index is 0
assert_eq!(0, a.0); This fails after changing column "a" to "f" let f = schema.column_with_name("f").unwrap();
# check that the column index is 0
- assert_eq!(0, f.0);
+ assert_eq!(4, f.0); So it looks like a safe solution is to assert that the field does exists, and not its order in the schema. By aliasing |
FYI I managed to solve my cyclic dependency issue in another way, by removing My attempt at removing the |
Given the sheer number of things that depend on indexmap (#1961), and that it no longer brings in an old version of hashbrown (it's only dependency), I wonder if this is still worth the effort of pursuing? If it were some esoteric crate with questionable maintenance sure, or with some crazy dependency graph, but I'm not sure that is the case? |
If the dependency is hard to remove and it isn't doing much harm then I agree the priority of the work might be lower? In general I think the fewer dependencies the better (for precisely the reason that removing them in the future is really hard) |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
We are using the indexmap for a relatively small usecase in the json reader to preserve insertion order.
This version isn't keeping up with dependencies (ses discussion on #1861 (comment))
Describe the solution you'd like
I would like to remove the use of
indexmap
entirely and streamline the arrow dependency chainFascinatingly when I apply the following diff all the tests pass (though I don't think it is entirely correct as
BTreeSet
andBTreeMap
do not actually preserve the insert order) so there is clearly a gap in test coverage tooDescribe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
This code and dependency appears to have come in originally via 8ef1fb8 / apache/arrow#3702 from(@nevi-me)
The text was updated successfully, but these errors were encountered: