code: def test_unique_and_drop_stability() -> None:
      # see: 2898
      # the original cause was that we wrote:
      # expr_a = a.unique()
      # expr_a.filter(a.unique().is_not_null())
      # meaning that the a.unique was executed twice, which is an unstable algorithm
      df = pl.DataFrame({"a": [1, None, 1, None]})
      assert (
          df.select(pl.col("a").unique().drop_nulls()).to_series()[0]
          == 1
      )
  
file_path: polars/py-polars/tests/unit/operations/unique/test_unique.py
imports: from __future__ import annotations
  from datetime import date
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_unique_and_drop_stability() without return types