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

Stop SQLAlchemy warnings about registering 'flatten' twice #521

Closed
Closed
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
1 change: 1 addition & 0 deletions src/snowflake/sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
VARBINARY,
VARIANT,
)
from .functions import flatten as flatten
from .util import _url as URL

base.dialect = dialect = snowdialect.dialect
Expand Down
5 changes: 1 addition & 4 deletions src/snowflake/sqlalchemy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
from sqlalchemy.orm import context
from sqlalchemy.orm.context import _MapperEntity
from sqlalchemy.schema import Sequence, Table
from sqlalchemy.sql import compiler, expression, functions
from sqlalchemy.sql import compiler, expression
from sqlalchemy.sql.base import CompileState
from sqlalchemy.sql.elements import quoted_name
from sqlalchemy.sql.selectable import Lateral, SelectState

from .compat import IS_VERSION_20, args_reducer, string_types
from .custom_commands import AWSBucket, AzureContainer, ExternalStage
from .functions import flatten
from .util import (
_find_left_clause_to_join_from,
_set_connection_interpolate_empty_sequences,
Expand Down Expand Up @@ -1064,5 +1063,3 @@ def visit_GEOMETRY(self, type_, **kw):


construct_arguments = [(Table, {"clusterby": None})]

functions.register_function("flatten", flatten)
Loading