code: def test_check_nan():
      X = pd.DataFrame(
          {
              "col1": ["hello world", "this is test", None],
              "col2": ["test test", "test test", "test"],
          }
      ).astype({"col1": "string", "col2": "string"})
      X_t = Vectorizer(
          per_column=True,
          analyzer="word",
          random_state=1,
      ).fit_transform(X.copy())
      assert X_t.shape == (3, 6)
  
      X_t = Vectorizer(
          analyzer="word",
          per_column=False,
          random_state=1,
      ).fit_transform(X.copy())
      assert X_t.shape == (3, 5)
  
file_path: auto-sklearn/test/test_pipeline/components/data_preprocessing/test_data_preprocessing_text.py
imports: import numpy
  import pandas
  from autosklearn.pipeline.components.data_preprocessing.text_encoding.tfidf_encoding import TfidfEncoder
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_check_nan() without return types