code: def test_sanitize_dataframe_infs():
      df = pd.DataFrame({"x": [0, 1, 2, np.inf, -np.inf, np.nan]})
      df_clean = sanitize_dataframe(df)
      assert list(df_clean.dtypes) == [object]
      assert list(df_clean["x"]) == [0, 1, 2, None, None, None]
  
file_path: ipyvega/vega/tests/test_utils.py
imports: import json
  import copy
  import numpy
  import pandas
  from ..utils import sanitize_dataframe, prepare_spec
label_desc: Use image node_id 2 for calling a global function with example usage: test_sanitize_dataframe_infs() without return types