code: def test_prepare_fg_from_dataframe(sagemaker_session_mock):
      very_long_name = "long" * 20
      df = pd.DataFrame(
          {
              "space feature": pd.Series([2.0], dtype="float64"),
              "dot.feature": pd.Series([2], dtype="int64"),
              very_long_name: pd.Series(["f1"], dtype="string"),
          }
      )
  
      feature_group = prepare_fg_from_dataframe_or_file(
          dataframe_or_path=df,
          session=sagemaker_session_mock,
          feature_group_name="testFG",
      )
  
      names = [
          fd.feature_name for fd in feature_group.feature_definitions
      ]
      types = [
          fd.feature_type for fd in feature_group.feature_definitions
      ]
  
      assert names == [
          "space_feature",
          "dotfeature",
          very_long_name[:62],
          "record_id",
          "data_as_of_date",
      ]
      assert types == [
          FeatureTypeEnum.FRACTIONAL,
          FeatureTypeEnum.INTEGRAL,
          FeatureTypeEnum.STRING,
          FeatureTypeEnum.INTEGRAL,
          FeatureTypeEnum.FRACTIONAL,
      ]
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/feature_store/test_feature_utils.py
imports: from __future__ import absolute_import
  import pandas
  import pytest
  from mock import Mock
  from sagemaker.feature_store.feature_utils import _cast_object_to_string, prepare_fg_from_dataframe_or_file, get_feature_group_as_dataframe
  from sagemaker.feature_store.feature_definition import FeatureTypeEnum
  from sagemaker.feature_store.feature_group import FeatureGroup
label_desc: Use image node_id 3 for calling a global function with example usage: test_prepare_fg_from_dataframe(sagemaker_session_mock) without return types