Skip to content

polars/polars-join-without-validate

Rule polars-join-without-validate
Pack Polars
Severity info
Fix none, edit by hand
Library versions every version

A Polars join allows duplicate keys on either side by default. Pass validate when the keys should be unique on one or both sides.

df.join(df, on="x")
df.join(df, on="x", validate="1:1")

Two identical keys on each side yielded 4 rows. 1:1 validation raised ComputeError.

Edit the code using the replacement in the example.

xpd prints this message with the issue. A name that starts with $ stands for code from your file.

A Polars join allows duplicate keys on either side by default. Pass validate when the keys should be unique on one or both sides.

Browse the other rules of the Polars pack.