Skip to content

Conversation

@carols10cents
Copy link
Contributor

Which issue does this PR close?

Closes #1398.

Rationale for this change

Give projects depending on datafusion more choice in what features to enable.

What changes are included in this PR?

Disabling default features for chrono and ahash in datafusion and ballista.

Are there any user-facing changes?

If projects depending on datafusion/ballista are making use of the coincidence that they turn on chrono or ahash features, this might mean they have to turn on the features themselves, but that would be a bug in that project's use of the crates.


[dependencies]
ahash = "0.7"
ahash = { version = "0.7", default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least hashbrown also depends on ahash by default.
So shouldn't we make that feature in hashbrown optional too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that makes sense!

The default feature set of the ahash crate is ["std"][1]. The std
feature enables features which require the standard library, namely
`AHashMap` and `AHashSet`. DataFusion currently only uses `AHasher`,
`CallHasher`, and `RandomState`, none of which require the standard
library.

This gives more control to projects depending on datafusion to minimize
the amount of code they depend on.

[1]: https://github.com/tkaitchuck/aHash/blob/e77cab8c1e15bfc9f54dfd28bd8820c2a7bb27c4/Cargo.toml#L24-L25
In fact, the "oldtime" feature is [considered deprecated][1] and only
included by default for backwards compatibility.

The other features don't appear to be used by datafusion or
ballista, so this gives projects depending on these crates more
flexibility in what they choose to include.

[1]: https://github.com/chronotope/chrono/blame/f6bd567bb677262645c1fc3131c8c1071cd77ec3/README.md#L88-L94
Copy link
Contributor

@Dandandan Dandandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @carols10cents !

@Dandandan Dandandan merged commit 8193e03 into apache:master Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turn off unused default features of chrono and ahash

3 participants