Skip to content

Conversation

JakubValtar
Copy link
Collaborator

This PR switches UniqueID to use UUID internally. This ensures uniqueness and preserves the ability to generate new unique IDs even after deserialization.

@wence- This changes the Python IR interface. The Cache::id_ field changes from usize to u128 since the ids now use 128 bits. I bumped the VERSION.

Closes #23674

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars labels Jul 23, 2025
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: The main changes are in this file.

@@ -229,7 +229,7 @@ pub struct Cache {
#[pyo3(get)]
input: usize,
#[pyo3(get)]
id_: usize,
id_: u128,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: The Python IR interface change is here.

@ritchie46
Copy link
Member

The lowerhex isn't important. Normal print should be fine.

Copy link

codecov bot commented Jul 23, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 6 lines in your changes missing coverage. Please review.

Project coverage is 81.29%. Comparing base (72e9513) to head (a2556e7).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-utils/src/unique_id.rs 60.00% 2 Missing ⚠️
crates/polars-plan/src/plans/ir/dot.rs 0.00% 1 Missing ⚠️
crates/polars-plan/src/plans/ir/tree_format.rs 0.00% 1 Missing ⚠️
...s-plan/src/plans/optimizer/collapse_and_project.rs 0.00% 1 Missing ⚠️
...rates/polars-python/src/lazyframe/visitor/nodes.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23704      +/-   ##
==========================================
+ Coverage   81.25%   81.29%   +0.03%     
==========================================
  Files        1644     1644              
  Lines      223318   223250      -68     
  Branches     2841     2841              
==========================================
+ Hits       181452   181481      +29     
+ Misses      41167    41070      -97     
  Partials      699      699              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ritchie46 ritchie46 merged commit e99abdc into pola-rs:main Jul 23, 2025
23 checks passed
@JakubValtar JakubValtar deleted the unique-id-uuid branch July 23, 2025 20:20
Washiil pushed a commit to Washiil/polars that referenced this pull request Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usage of UniqueId::default() is not sound when there are Plain variants in memory
2 participants