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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dialect atribute wasn't provided #291

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqlalchemy_bigquery/__init__.py
Expand Up @@ -22,7 +22,7 @@

from .version import __version__ # noqa

from .base import BigQueryDialect
from .base import BigQueryDialect, dialect # noqa
from .base import (
STRING,
BOOL,
Expand Down
2 changes: 2 additions & 0 deletions sqlalchemy_bigquery/base.py
Expand Up @@ -986,6 +986,8 @@ def get_view_definition(self, connection, view_name, schema=None, **kw):
return view.view_query


dialect = BigQueryDialect

try:
import alembic # noqa
except ImportError:
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/test_sqlalchemy_bigquery.py
Expand Up @@ -171,3 +171,10 @@ def test_multi_value_insert(faux_conn, last_query):
" (%(id_m0:INT64)s), (%(id_m1:INT64)s), (%(id_m2:INT64)s)",
{"id_m0": 0, "id_m1": 1, "id_m2": 2},
)


def test_follow_dialect_attribute_convention():
import sqlalchemy_bigquery.base

assert sqlalchemy_bigquery.dialect is sqlalchemy_bigquery.BigQueryDialect
assert sqlalchemy_bigquery.base.dialect is sqlalchemy_bigquery.BigQueryDialect