code: def test_transform_column_dest_column_already_present(dataframe):
      """Test behaviour when new destination column is provided and already
      exists."""
      # If dest_column_name already exists, throw an error
      with pytest.raises(
          ValueError,
          match="pyjanitor already present in dataframe",
      ):
          _ = dataframe.assign(pyjanitor=1).transform_column(
              "a",
              np.log10,
              dest_column_name="pyjanitor",
          )
  
      # unless dest_column_name is the same as column_name (the column being
      # transformed); assume user wants an in-place transformation in this
      # case.
      expected_df = dataframe.copy().assign(a=np.log10(dataframe["a"]))
      result_df = dataframe.transform_column(
          "a",
          np.log10,
          dest_column_name="a",
      )
      assert_frame_equal(result_df, expected_df)
  
file_path: pyjanitor/tests/functions/test_transform_column.py
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_transform_column_dest_column_already_present(dataframe) without return types