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

add num-complex requirement #4482

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

mwlon
Copy link
Contributor

@mwlon mwlon commented Jul 8, 2023

Which issue does this PR close?

Closes #3849

Rationale for this change

More correct package dependencies.

arrow-array relies on the num-complex crate and uses its ComplexFloat trait, but that was only released in 0.4.2. The num dependency alone only requires num-complex 0.4.0, so this can cause compilation errors:

error[E0432]: unresolved import `num::complex::ComplexFloat`
  --> /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-array-30.0.1/src/arithmetic.rs:21:5
   |
21 | use num::complex::ComplexFloat;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ComplexFloat` in `complex`

error[E0599]: no method named `powi` found for struct `f16` in the current scope
   --> /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-array-30.0.1/src/arithmetic.rs:351:25
    |
351 |                 Ok(self.powi(exp as i32))
    |                         ^^^^ method not found in `f16`
...
380 | native_type_float_op!(f16, f16::ONE, f16::ZERO);
    | ----------------------------------------------- in this macro invocation
    |
    = help: items from traits can only be used if the trait is in scope
    = note: this error originates in the macro `native_type_float_op` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
    |
18  + use num::Float;
    |
18  + use num::traits::float::FloatCore;
    |
18  + use num::traits::real::Real;
    |

error[E0599]: no method named `powi` found for struct `f16` in the current scope
   --> /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arrow-array-30.0.1/src/arithmetic.rs:356:22
    |
356 |                 self.powi(exp as i32)
    |                      ^^^^ method not found in `f16`
...
380 | native_type_float_op!(f16, f16::ONE, f16::ZERO);
    | ----------------------------------------------- in this macro invocation
    |
    = help: items from traits can only be used if the trait is in scope
    = note: this error originates in the macro `native_type_float_op` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
    |
18  + use num::Float;
    |
18  + use num::traits::float::FloatCore;
    |
18  + use num::traits::real::Real;
    |

What changes are included in this PR?

Cargo.toml change to arrow-array

Are there any user-facing changes?

no

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jul 8, 2023
@tustvold
Copy link
Contributor

tustvold commented Jul 8, 2023

Could we perhaps just update the num requirement to 0.4.2?

@mwlon
Copy link
Contributor Author

mwlon commented Jul 8, 2023

@tustvold there is no num 0.4.2. There is only 0.4.0, which depends on num-complex 0.4.0. I think we need to specify the version num-complex specifically.

Filed rust-num/num#426 because this is indeed a bit annoying.

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.

Cargo.toml dependencies aren't accurate
2 participants