code: def test_split_nan_expand(any_string_dtype):
      # gh-18450
      s = Series(["foo,bar,baz", np.nan], dtype=any_string_dtype)
      result = s.str.split(",", expand=True)
      exp = DataFrame(
          [["foo", "bar", "baz"], [np.nan, np.nan, np.nan]],
          dtype=any_string_dtype,
      )
      tm.assert_frame_equal(result, exp)
  
      # check that these are actually np.nan/pd.NA and not None
      # TODO see GH 18463
      # tm.assert_frame_equal does not differentiate
      if any_string_dtype in object_pyarrow_numpy:
          assert all(np.isnan(x) for x in result.iloc[1])
      else:
          assert all(x is pd.NA for x in result.iloc[1])
  
imports: from datetime import datetime
  import re
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series, _testing
  from pandas.tests.strings import _convert_na_value, object_pyarrow_numpy
label_desc: Use image node_id 28 for calling a global function with example usage: test_split_nan_expand(any_string_dtype) without return types