code: def test_compare_frame_equal_nested_nans() -> None:
      # list dtype
      df1 = pl.DataFrame(
          data={"x": [[1.0, nan]], "y": [[nan, 2.0]]},
          schema=[
              ("x", pl.List(pl.Float32)),
              ("y", pl.List(pl.Float64)),
          ],
      )
      assert_frame_equal(df1, df1, check_exact=True)
  
      df2 = pl.DataFrame(
          data={"x": [[1.0, nan]], "y": [[None, 2.0]]},
          schema=[
              ("x", pl.List(pl.Float32)),
              ("y", pl.List(pl.Float64)),
          ],
      )
      assert_frame_not_equal(df1, df2)
      with pytest.raises(
          AssertionError, match="value mismatch for column 'y'"
      ):
          assert_frame_equal(df1, df2, check_exact=True)
  
      # struct dtype
      df3 = pl.from_dicts(
          [
              {
                  "id": 1,
                  "struct": [
                      {"x": "text", "y": [0.0, nan]},
                      {"x": "text", "y": [0.0, nan]},
                  ],
              },
              {
                  "id": 2,
                  "struct": [
                      {"x": "text", "y": [1]},
                      {"x": "text", "y": [1]},
                  ],
              },
          ]
      )
      df4 = pl.from_dicts(
          [
              {
                  "id": 1,
                  "struct": [
                      {"x": "text", "y": [0.0, nan], "z": ["$"]},
                      {"x": "text", "y": [0.0, nan], "z": ["$"]},
                  ],
              },
              {
                  "id": 2,
                  "struct": [
                      {"x": "text", "y": [nan, 1], "z": ["!"]},
                      {"x": "text", "y": [nan, 1], "z": ["?"]},
                  ],
              },
          ]
      )
  
      assert_frame_equal(df3, df3)
      assert_frame_equal(df4, df4)
  
      assert_frame_not_equal(df3, df4)
      for check_dtype in (True, False):
          with pytest.raises(
              AssertionError, match="mismatch|different"
          ):
              assert_frame_equal(df3, df4, check_dtype=check_dtype)
  
file_path: polars/py-polars/tests/unit/testing/test_assert_frame_equal.py
imports: from __future__ import annotations
  import math
  from typing import Any
  import pytest
  import polars
  from polars.exceptions import InvalidAssert
  from polars.testing import assert_frame_equal, assert_frame_not_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_compare_frame_equal_nested_nans() without return types