Skip to content
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

fix create_engine("snowflake://").dialect #387

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix #386 create_engine("snowflake://").dialect
rooterkyberian committed Feb 12, 2023
commit 1875bc6f4d809934cd03597fcfdfb2418f46abbf
2 changes: 1 addition & 1 deletion src/snowflake/sqlalchemy/snowdialect.py
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@ def create_connect_args(self, url):
raise sa_exc.ArgumentError(
f"Invalid name space is specified: {opts['database']}"
)
if ".snowflakecomputing.com" not in opts["host"] and not opts.get("port"):
if "host" in opts and ".snowflakecomputing.com" not in opts["host"] and not opts.get("port"):
sfc-gh-aling marked this conversation as resolved.
Show resolved Hide resolved
opts["account"] = opts["host"]
if "." in opts["account"]:
# remove region subdomain
11 changes: 11 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
@@ -184,6 +184,17 @@ def test_connect_args(verify_app_name):
engine.dispose()


def test_create_dialect():
"""
Tests getting only dialect object through create_engine
"""
engine = create_engine("snowflake://")
try:
assert engine.dialect
finally:
engine.dispose()


def test_simple_sql(engine_testaccount):
"""
Simple SQL by SQLAlchemy