I am a python newb (clearly) . I just had a quick question. How do I define a sql query as a variable? The goal is to use this database table as the dataset for modeling purposes, but I don't know how to define the table or query as a variable syntax wise. Please help!
import pandas as pd
import numpy as np
import snowflake.connector
OKTA_USER = 'username'
OKTA_PASSWORD = 'pw!'
con = snowflake.connector.connect(
user=OKTA_USER,
password=OKTA_PASSWORD,
account='account',
authenticator='account link',
)
cur = con.cursor()
cur.execute("USE WAREHOUSE WH_GENERAL")
dataset = 'SELECT * FROM table LIMIT 10'