8000 fix: DSL_SCHEMA_HASH should not changed by line endings by eitsupi · Pull Request #25123 · pola-rs/polars · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@eitsupi
Copy link
Contributor
@eitsupi eitsupi commented Nov 1, 2025

Ref: pola-rs/r-polars#1625

If we reference Polars on GitHub and build it from Windows, Git for Windows may rewrite the line ending characters from LF to CRLF, resulting in a different value for DSL_SCHEMA_HASH.
By replacing CRLF to LF before hashing, we can prevent such accidents.

Currently, Python Polars on Windows has a different DSL_SCHEMA_HASH compared to other platforms:

polars.exceptions.ComputeError: deserialization failed

given DSL_SCHEMA_HASH: 6286bad7b59c6dffbabcb7eda0d3a1c386cc651ad8b2479b2e4e4686199e04e1 is not compatible with this Polars version which uses DSL_SCHEMA_HASH: 45389c69048be32a61fcfa8990e6bd529f3d369c229e6004318f7e15baa0b597
error: can't deserialize DSL with incompatible schema
  • Other Platforms: 6286bad7b59c6dffbabcb7eda0d3a1c386cc651ad8b2479b2e4e4686199e04e1
  • Windows: 45389c69048be32a61fcfa8990e6bd529f3d369c229e6004318f7e15baa0b597

As shown below, it can be confirmed that this is the result of replacing the line ending characters from LF to CRLF.

$ wget \
    https://raw.githubusercontent.com/pola-rs/polars/df69276daf5d195c8feb71eef82cbe9804e0f47f/crates/polars-plan/dsl-schema-hashes.json \
    --quiet
$ sha256sum dsl-schema-hashes.json
6286bad7b59c6dffbabcb7eda0d3a1c386cc651ad8b2479b2e4e4686199e04e1  dsl-schema-hashes.json
$ sed -e 's/$/\r/g' dsl-schema-hashes.json | head -c -1 >crlf.json
$ sha256sum crlf.json
45389c69048be32a61fcfa8990e6bd529f3d369c229e6004318f7e15baa0b597  crlf.json

@github-actions github-actions bot added fix Bug fix rust Related to Rust Polars labels Nov 1, 2025
@codecov
Copy link
codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.80%. Comparing base (df69276) to head (e874e82).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25123      +/-   ##
==========================================
+ Coverage   81.79%   81.80%   +0.01%     
==========================================
  Files        1708     1708              
  Lines      236112   236112              
  Branches     3005     3005              
==========================================
+ Hits       193117   193153      +36     
+ Misses      42227    42191      -36     
  Partials      768      768              

☔ 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.

@eitsupi eitsupi changed the title fix(rust): DSL_SCHEMA_HASH should not changed by line endings fix: DSL_SCHEMA_HASH should not changed by line endings / Python Polars wheels for Windows have different DSL_SCHEMA_HASH Nov 2, 2025
@github-actions github-actions bot added the python Related to Python Polars label Nov 2, 2025
@eitsupi eitsupi changed the title fix: DSL_SCHEMA_HASH should not changed by line endings / Python Polars wheels for Windows have different DSL_SCHEMA_HASH fix: DSL_SCHEMA_HASH should not changed by line endings Nov 2, 2025
@ritchie46 ritchie46 merged commit cad5304 into pola-rs:main Nov 3, 2025
30 checks passed
@eitsupi eitsupi deleted the ensure-lf branch November 3, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix python Related to Python Polars rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0