Skip to content

Commit 6837f48

Browse files
authored
Merge pull request #33 from eifrach/create_default_warehouse
NO-ISSUE: setting the default warehouse
2 parents 90191fe + 19b93e5 commit 6837f48

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
max-line-length = 120
3+
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,venv,.venv
4+
ignore = E501,W503

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
Snowflake_CSV/
22
.venv/
3+
**/*.pvc
4+
__pycache__/

src/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
SNOWFLAKE_BASE_URL = os.environ.get("SNOWFLAKE_BASE_URL")
1616
SNOWFLAKE_DATABASE = os.environ.get("SNOWFLAKE_DATABASE")
1717
SNOWFLAKE_SCHEMA = os.environ.get("SNOWFLAKE_SCHEMA")
18+
SNOWFLAKE_WAREHOUSE = os.environ.get("SNOWFLAKE_WAREHOUSE", "DEFAULT")
1819

1920
# Snowflake token handling - for stdio transport, get from environment
2021
# For other transports, it will be retrieved from request context in tools layer

src/database.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
SNOWFLAKE_BASE_URL,
1010
SNOWFLAKE_DATABASE,
1111
SNOWFLAKE_SCHEMA,
12-
SNOWFLAKE_TOKEN
12+
SNOWFLAKE_TOKEN,
13+
SNOWFLAKE_WAREHOUSE
1314
)
1415
from metrics import track_snowflake_query
1516

@@ -85,7 +86,8 @@ async def execute_snowflake_query(sql: str, snowflake_token: Optional[str] = Non
8586
"statement": sql,
8687
"timeout": 60,
8788
"database": SNOWFLAKE_DATABASE,
88-
"schema": SNOWFLAKE_SCHEMA
89+
"schema": SNOWFLAKE_SCHEMA,
90+
"warehouse": SNOWFLAKE_WAREHOUSE,
8991
}
9092

9193
logger.info(f"Executing Snowflake query: {sql[:100]}...") # Log first 100 chars of query

0 commit comments

Comments
 (0)