pola-rs / polars

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

Add to `.eq_missing()` a comment about what happens in the case of `Null.eq_missing(Number)` #16867

Open DeflateAwning opened 3 weeks ago

DeflateAwning commented 3 weeks ago

Description

Add to .eq_missing() a comment about what happens in the case of Null.eq_missing(Number).

Currently:

Method equivalent of equality operator expr == other where None == None.

Why it bothers me

The issue is that this description doesn't explicitly say that the behaviour of null==number is different than with the normal equality check.

To be fair, the example does cover this case, so it's not super urgent, but it still matters to me.

Proposed change:

Method equivalent of equality operator `expr == other` where `None == None` and `None == number` is False.

Link

https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.eq_missing.html

mcrumiller commented 3 weeks ago

I propose the more concise:

Equality operator where None is treated as a distinct value.

maybe followed with a few examples showing that None == None and x != None for all other x.