code: def test_df_to_sql_if_exists_replace(mock_upload_to_s3, mock_g):
      config = app.config.copy()
      app.config["CSV_TO_HIVE_UPLOAD_DIRECTORY_FUNC"]: lambda *args: ""
      mock_upload_to_s3.return_value = "mock-location"
      mock_g.user = True
      mock_database = mock.MagicMock()
      mock_database.get_df.return_value.empty = False
      mock_execute = mock.MagicMock(return_value=True)
      mock_database.get_sqla_engine_with_context.return_value.__enter__.return_value.execute = (
          mock_execute
      )
      table_name = "foobar"
  
      with app.app_context():
          HiveEngineSpec.df_to_sql(
              mock_database,
              Table(table=table_name),
              pd.DataFrame(),
              {
                  "if_exists": "replace",
                  "header": 1,
                  "na_values": "mock",
                  "sep": "mock",
              },
          )
  
      mock_execute.assert_any_call(f"DROP TABLE IF EXISTS {table_name}")
      app.config = config
  
imports: from unittest import mock
  import pytest
  import pandas
  from sqlalchemy.sql import select
  from superset.db_engine_specs.hive import HiveEngineSpec, upload_to_s3
  from superset.exceptions import SupersetException
  from superset.sql_parse import Table, ParsedQuery
  from tests.integration_tests.test_app import app
label_desc: Use image node_id 13 for calling a global function with example usage: test_df_to_sql_if_exists_replace(mock_upload_to_s3, mock_g) without return types