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

Ensure necessary lexical-core features are used in arrow-json. #6960

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Alexhuszagh
Copy link

Which issue does this PR close?

Closes #6959

Rationale for this change

This ensures that disabling features in arrow-cast would not cause compilation errors arrow-json which independently relies but does not enable those features.

What changes are included in this PR?

Enables the required features in arrow-json for a dependency.

Are there any user-facing changes?

N/A

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jan 9, 2025
@tustvold
Copy link
Contributor

tustvold commented Jan 9, 2025

Is there some way we can test for this?

Am I right in thinking there is no way to run into this without code modification, wondering if this is actually an end-user visible bug?

@Alexhuszagh
Copy link
Author

Is there some way we can test for this?

Am I right in thinking there is no way to run into this without code modification, wondering if this is actually an end-user visible bug?

I don't believe so. It would definitely not be end-user visible, but it might cause unexpected compilation failures in the case of changes being made in arrow-cast.

@crepererum
Copy link
Contributor

I think the test would be: run cargo check for every crate (not the workspace!) and every feature combination. I'm not sure if this is worth the CI time that this would burn.

@tustvold
Copy link
Contributor

We actually do this https://github.com/apache/arrow-rs/blob/main/.github%2Fworkflows%2Farrow.yml#L207

I think the thing here is that without code modification there isn't a way to run into this

@alamb
Copy link
Contributor

alamb commented Jan 10, 2025

Thank you for this PR @Alexhuszagh

I agree with @tustvold that unless there is a problem we are fixing we shouldn't make this change

I double checked that arrow-json runs fine without the default features enabled

(venv) andrewlamb@Andrews-MacBook-Pro-2:~/Software/arrow-rs$ cargo check --no-default-features -p arrow-json
   Compiling libc v0.2.169
    Checking arrow-schema v54.0.0 (/Users/andrewlamb/Software/arrow-rs/arrow-schema)
    Checking zerocopy v0.7.35
    Checking once_cell v1.20.2
   Compiling serde v1.0.217
   Compiling serde_json v1.0.134
    Checking indexmap v2.7.0
    Checking arrow-buffer v54.0.0 (/Users/andrewlamb/Software/arrow-rs/arrow-buffer)
    Checking arrow-data v54.0.0 (/Users/andrewlamb/Software/arrow-rs/arrow-data)
    Checking getrandom v0.2.15
    Checking ahash v0.8.11
    Checking arrow-array v54.0.0 (/Users/andrewlamb/Software/arrow-rs/arrow-array)
    Checking arrow-select v54.0.0 (/Users/andrewlamb/Software/arrow-rs/arrow-select)
    Checking arrow-cast v54.0.0 (/Users/andrewlamb/Software/arrow-rs/arrow-cast)
    Checking arrow-json v54.0.0 (/Users/andrewlamb/Software/arrow-rs/arrow-json)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.38s

I also verified that a new cargo project that only arrow-json without default features works fine too:

[package]
name = "test_arrow_json"
version = "0.1.0"
edition = "2021"

[dependencies]
arrow-json = { version = "54.0.0", default-features = false }
/Users/andrewlamb/.cargo/bin/cargo run --color=always --package test_arrow_json --bin test_arrow_json --profile dev
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/test_arrow_json`
Hello, world!

Full project is here: test_arrow_json.tar.gz

@Alexhuszagh
Copy link
Author

I agree with @tustvold that unless there is a problem we are fixing we shouldn't make this change

I double checked that arrow-json runs fine without the default features enabled

Correct, because of how arrow-cast enables those features so they will be enabled regardless. If arrow-cast ever changes those features, it would break arrow-json since arrow-json depends on that functionality but doesn't actually request those features. Since both are managed internally I entirely understand if that's not an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect Use of Features For arrow-json with Lexical
4 participants