-
Notifications
You must be signed in to change notification settings - Fork 3
add dbt integration tests #812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f536d12
to
314ffcc
Compare
314ffcc
to
12c641b
Compare
response.raise_for_status() | ||
|
||
## SCHEMA | ||
query = f"CREATE SCHEMA IF NOT EXISTS {catalog}.{schema}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we technically don't have this API easily working (since UI now requires some other attributes like worksheet_id and authentication token), here is the code I used to create schema that might be better fit here
def create_table(database, schema, table, query):
import snowflake.connector
USER = os.getenv("SNOWFLAKE_USER", "xxx")
PASSWORD = os.getenv("SNOWFLAKE_PASSWORD", "yyy")
ACCOUNT = os.getenv("SNOWFLAKE_ACCOUNT", "acc")
DATABASE = os.getenv("SNOWFLAKE_DATABASE", database)
SCHEMA = os.getenv("SNOWFLAKE_SCHEMA", schema)
WAREHOUSE = os.getenv("SNOWFLAKE_WAREHOUSE", "")
con = snowflake.connector.connect(
host=os.getenv("SNOWFLAKE_HOST", "localhost"),
port=os.getenv("SNOWFLAKE_PORT", 3000),
protocol=os.getenv("SNOWFLAKE_PROTOCOL", "http"),
user=USER,
password=PASSWORD,
account=ACCOUNT,
warehouse=WAREHOUSE,
database=DATABASE,
schema=SCHEMA,
session_parameters={
"QUERY_TAG": "dbt-testing",
},
)
cursor = con.cursor()
cursor.execute(f"CREATE SCHEMA IF NOT EXISTS {database}.{schema}")
cursor.execute(query)
@osmazur Feel free to mark conversation as resolved and merge |
Add dbt integration tests, packages edition:
Configured to run against snowflake or embucket.
Structure: