Skip to content

Commit d43dcdb

Browse files
authored
feat: Make DSL-hash skippable (#25140)
1 parent 2a48d78 commit d43dcdb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/polars-plan/src/dsl/plan.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ impl DslPlan {
319319
reader.read_exact(&mut schema_hash).map_err(
320320
|e| polars_err!(ComputeError: "failed to read incoming DSL_SCHEMA_HASH: {e}"),
321321
)?;
322+
322323
let incoming_hash = SchemaHash::new(&schema_hash).ok_or_else(
323324
|| polars_err!(ComputeError: "failed to read incoming DSL schema hash, not a valid hex string")
324325
)?;
@@ -329,7 +330,9 @@ impl DslPlan {
329330
);
330331
}
331332

332-
if incoming_hash != DSL_SCHEMA_HASH {
333+
if std::env::var("POLARS_SKIP_DSL_HASH_VERIFICATION").as_deref() != Ok("1")
334+
&& incoming_hash != DSL_SCHEMA_HASH
335+
{
333336
polars_bail!(ComputeError:
334337
"deserialization failed\n\ngiven DSL_SCHEMA_HASH: {incoming_hash} is not compatible with this Polars version which uses DSL_SCHEMA_HASH: {DSL_SCHEMA_HASH}\n{}",
335338
"error: can't deserialize DSL with incompatible schema"

0 commit comments

Comments
 (0)