pola-rs / polars

Dataframes powered by a multithreaded, vectorized query engine, written in Rust
https://docs.pola.rs
Other
30.57k stars 1.98k forks source link

error[E0599]: no method named `raw_table_mut` found for struct `hashbrown::HashMap` in the current scope #19157

Open yurivict opened 1 month ago

yurivict commented 1 month ago

Checks

Reproducible example

build

Log output

n/a

Issue description

Build fails:

error[E0599]: no method named `raw_table_mut` found for struct `hashbrown::HashMap` in the current scope
   --> crates/polars-core/src/chunked_array/builder/list/categorical.rs:145:33
    |
145 |                 self.idx_lookup.raw_table_mut().find_or_find_insert_slot(
    |                                 ^^^^^^^^^^^^^ method not found in `HashMap<KeyWrapper, (), RandomState>`

error[E0599]: no method named `raw_table_mut` found for struct `hashbrown::HashMap` in the current scope
   --> crates/polars-core/src/chunked_array/builder/list/categorical.rs:164:41
    |
164 |                         self.idx_lookup.raw_table_mut().insert_in_slot(
    |                                         ^^^^^^^^^^^^^ method not found in `HashMap<KeyWrapper, (), RandomState>`

error[E0599]: no method named `raw_table_mut` found for struct `hashbrown::HashMap` in the current scope
  --> crates/polars-core/src/chunked_array/logical/categorical/builder.rs:43:32
   |
43 |             self.local_mapping.raw_table_mut().find_or_find_insert_slot(
   |                                ^^^^^^^^^^^^^ method not found in `HashMap<KeyWrapper, (), RandomState>`

error[E0599]: no method named `raw_table_mut` found for struct `hashbrown::HashMap` in the current scope
  --> crates/polars-core/src/chunked_array/logical/categorical/builder.rs:63:26
   |
62 | /                     self.local_mapping
63 | |                         .raw_table_mut()
   | |                         -^^^^^^^^^^^^^ method not found in `HashMap<KeyWrapper, (), RandomState>`
   | |_________________________|
   |

For more information about this error, try `rustc --explain E0599`.
error: could not compile `polars-core` (lib) due to 4 previous errors
💥 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.11-64bit" PYO3_PYTHON="/usr/local/bin/python3.11" PYTHON_SYS_EXECUTABLE="/usr/local/bin/python3.11" "cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "/usr/ports/misc/py-polars/work-py311/polars-py-1.9.0/py-polars/Cargo.toml" "--release" "--lib"`
Error: command ['maturin-3.11', 'pep517', 'build-wheel', '-i', '/usr/local/bin/python3.11', '--compatibility', 'off'] returned non-zero exit status 1

ERROR Backend subprocess exited when trying to invoke build_wheel
*** Error code 1

Expected behavior

n/a

Installed versions

polars-1.9.0 rust-nightly-1.83.0.20241001 FreeBSD 14.1

cmdlineluser commented 1 month ago

I think there was a recent commit on main to address this:

Ari-suhyeon commented 1 month ago

When will the version be updated?

kenkoooo commented 1 month ago

I'm not entirely sure when this bug was introduced, but the main cause seems to be the use of hashbrown without its raw feature flag when dtype-categorical is enabled on the Polars side.

As a workaround, you can add the following line to your Cargo.toml to resolve the issue by including hashbrown with the raw feature in your dependencies.

hashbrown = { version = "0.14.5", features = ["raw"] }

From what I understand, this issue should be resolved by replacing hashbrown 0.14.5 with 0.15. Since some people have already started working on the replacement, I believe we can close this issue soon!