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

Test pr 387 #393

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/snowflake/sqlalchemy/snowdialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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