Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion src/snowflake/sqlalchemy/snowdialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ 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")
):
opts["account"] = opts["host"]
if "." in opts["account"]:
# remove region subdomain
Expand Down
11 changes: 11 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down