code: def test_to_dataframe_with_dataframe(
      remove_mock,
      read_csv_mock,
      to_csv_file_mock,
      sagemaker_session_mock,
  ):
      dataframe = pd.DataFrame(
          {"feature-1": [420, 380.0, 390], "feature-2": [50, 40.0, 45]}
      )
      dataset_builder = DatasetBuilder(
          sagemaker_session=sagemaker_session_mock,
          base=dataframe,
          output_path="s3://file/to/path",
          event_time_identifier_feature_name="feature-2",
      )
      sagemaker_session_mock.start_query_execution.return_value = {
          "QueryExecutionId": "query-id"
      }
      sagemaker_session_mock.get_query_execution.return_value = {
          "QueryExecution": {
              "Status": {"State": "SUCCEEDED"},
              "ResultConfiguration": {
                  "OutputLocation": "s3://s3-file-path"
              },
              "Query": "query-string",
          }
      }
      to_csv_file_mock.return_value = None
      read_csv_mock.return_value = dataframe
      os.remove.return_value = None
      df, query_string = dataset_builder.to_dataframe()
      assert df.equals(dataframe)
      assert query_string == "query-string"
  
imports: from __future__ import absolute_import
  import datetime
  import pandas
  import pytest
  import os
  from mock import Mock, patch
  from sagemaker.feature_store.dataset_builder import DatasetBuilder, FeatureGroupToBeMerged, TableType, JoinComparatorEnum, JoinTypeEnum
  from sagemaker.feature_store.feature_group import FeatureDefinition, FeatureGroup, FeatureTypeEnum
label_desc: Use image node_id 17 for calling a global function with example usage: test_to_dataframe_with_dataframe(remove_mock, read_csv_mock, to_csv_file_mock, sagemaker_session_mock) without return types