code: def test_truncate_datetime_dataframe_invalid_datepart():
      """Checks if a ValueError is appropriately raised when datepart is
      not a valid enumeration.
      """
      with pytest.raises(ValueError, match=r"invalid `datepart`"):
          pd.DataFrame().truncate_datetime_dataframe("INVALID")
  
file_path: pyjanitor/tests/functions/test_truncate_datetime.py
imports: from datetime import datetime
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 1 for calling a global function with example usage: test_truncate_datetime_dataframe_invalid_datepart() without return types