title: Table Does Not Exist Error When Using write_pandas
body: <p>I have a very frustrating issue. At the bottom of this post is a function I created to (1) create a table in snowflake and (2) store a dataframe to that table.</p>
  <p>The creation of the table is work fine. The issue is happening specifically with writepandas the code snippet:</p>
  <pre><code>    write_pandas(
                  conn=conn,
                  df=df,
                  table_name=table_name,
                  database=database,
                  schema=schema
              )
  </code></pre>
  <p>I keep getting an error that the table I created &quot;doesn't exist&quot; because the naming convention is off .. for instance in the database the table is created as <code>&quot;DATABASE&quot;.&quot;SCHEMA&quot;.&quot;TABLE&quot;</code> but the error message says <code>'DATABASE.SCHEMA.&quot;TABLE&quot;' does not exist</code></p>
  <p>I know this is a simple issue but Im stuck for the moment. Any help would be appreciated.</p>
  <pre><code>from datetime import datetime, timedelta, date
  from airflow import DAG
  from airflow.providers.snowflake.operators.snowflake import SnowflakeOperator
  from sqlalchemy import create_engine
  import requests
  from pandas.io.json import json_normalize 
  import numpy as np
  from sqlalchemy.types import Integer, Text, String, DateTime
  from IPython.display import display, HTML
  from flatten_json import flatten
  from snowflake.connector import connect
  from snowflake.connector.pandas_tools import write_pandas
  from airflow.operators.python_operator import PythonOperator
  import os
  from airflow.providers.snowflake.hooks.snowflake import SnowflakeHook
  import pandas as pd
  from sklearn.preprocessing import MinMaxScaler
  
  def create_store_snowflake(df,table):
      #quick transforms 
      df = df.rename(columns=str.upper)
  
      df.columns = df.columns.str.replace('[-,/]','')
      #Define the table name, schema, and database you want to write to
      #Note: the table, schema, and database need to already exist in Snowflake
      
      #Define the table name, schema, and database you want to write to
  
      table_name = table
      schema = 'schema'
      database = 'database'
  
      #Connect to Snowflake using the required user
  
      conn = connect(
              user=&quot;user&quot;,
              password=&quot;password&quot;,
              account=&quot;account&quot;,
              role=&quot;role&quot;,
              database = &quot;database&quot;,
              schema = 'schema'
          )
  
      #reroute raw data to dataframe variable
      dataframe = df
  
      #Create the SQL statement to create or replace the table
  
      create_tbl_statement = &quot;CREATE OR REPLACE TABLE &quot; + database + &quot;.&quot; + schema + &quot;.&quot; + table_name + &quot; (\n&quot;
  
      # Loop through each column finding the datatype and adding it to the statement
  
      for column in dataframe.columns:
          if (
          dataframe[column].dtype.name == &quot;int&quot;
          or dataframe[column].dtype.name == &quot;int64&quot;
          ):
              create_tbl_statement = create_tbl_statement + column + &quot; int&quot;
          elif dataframe[column].dtype.name == &quot;object&quot;:
              create_tbl_statement = create_tbl_statement + column + &quot; varchar(16777216)&quot;
          elif dataframe[column].dtype.name == &quot;datetime64[ns]&quot;:
              create_tbl_statement = create_tbl_statement + column + &quot; datetime&quot;
          elif dataframe[column].dtype.name == &quot;float64&quot;:
              create_tbl_statement = create_tbl_statement + column + &quot; float8&quot;
          elif dataframe[column].dtype.name == &quot;bool&quot;:
              create_tbl_statement = create_tbl_statement + column + &quot; boolean&quot;
          else:
              create_tbl_statement = create_tbl_statement + column + &quot; varchar(16777216)&quot;
  
          # If column is not last column, add comma, else end sql-query
          if dataframe[column].name != dataframe.columns[-1]:
              create_tbl_statement = create_tbl_statement + &quot;,\n&quot;
          else:
              create_tbl_statement = create_tbl_statement + &quot;)&quot;
  
      #Execute the SQL statement to create the table
  
      conn.cursor().execute(create_tbl_statement)
  
      print(f&quot;{table_name} created!&quot;)
  
      #write df to created table
      write_pandas(
                  conn=conn,
                  df=df,
                  table_name=table_name,
                  database=database,
                  schema=schema
              )
  
      print(df.shape[0],f&quot;rows written to {table_name} in Snowflake&quot;)
  </code></pre>