Skip to content
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

Minimize features #1399

Merged
merged 2 commits into from
Dec 18, 2021
Merged

Minimize features #1399

merged 2 commits into from
Dec 18, 2021

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.

@github-actions github-actions bot added ballista datafusion Changes in the datafusion crate labels Dec 3, 2021
@@ -30,7 +30,7 @@ build = "build.rs"
simd = ["datafusion/simd"]

[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
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turn off unused default features of chrono and ahash
3 participants