Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astus committed Mar 8, 2024
1 parent 7bf66e5 commit 52ad7b4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/snowflake/sqlalchemy/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,18 @@ def datetime_implicit_bound(self):
# Check https://snowflakecomputing.atlassian.net/browse/SNOW-640134 for details on breaking changes discussion.
return exclusions.closed()

@property
def date_implicit_bound(self):
# Supporting this would require behavior breaking change to implicitly convert str to timestamp when binding
# parameters in string forms of timestamp values.
return exclusions.closed()

@property
def time_implicit_bound(self):
# Supporting this would require behavior breaking change to implicitly convert str to timestamp when binding
# parameters in string forms of timestamp values.
return exclusions.closed()

@property
def timestamp_microseconds_implicit_bound(self):
# Supporting this would require behavior breaking change to implicitly convert str to timestamp when binding
Expand Down
22 changes: 22 additions & 0 deletions tests/sqlalchemy_test_suite/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
from sqlalchemy.schema import Column, Sequence, Table
from sqlalchemy.testing import config
from sqlalchemy.testing.assertions import eq_
from sqlalchemy.testing.suite import (
BizarroCharacterFKResolutionTest as _BizarroCharacterFKResolutionTest,
)
from sqlalchemy.testing.suite import (
CompositeKeyReflectionTest as _CompositeKeyReflectionTest,
)
Expand Down Expand Up @@ -69,6 +72,10 @@ def test_empty_insert(self, connection):
def test_empty_insert_multiple(self, connection):
pass

@pytest.mark.skip("Snowflake does not support returning in insert.")
def test_no_results_for_non_returning_insert(self, connection, style, executemany):
pass


# 2. Patched Tests

Expand Down Expand Up @@ -149,3 +156,18 @@ def test_fk_column_order(self):
def test_pk_column_order(self):
# Check https://snowflakecomputing.atlassian.net/browse/SNOW-640134 for details on breaking changes discussion.
super().test_pk_column_order()


class BizarroCharacterFKResolutionTest(_BizarroCharacterFKResolutionTest):
@testing.combinations(
("id",), ("(3)",), ("col%p",), ("[brack]",), argnames="columnname"
)
@testing.variation("use_composite", [True, False])
@testing.combinations(
("plain",),
("(2)",),
("[brackets]",),
argnames="tablename",
)
def test_fk_ref(self, connection, metadata, use_composite, tablename, columnname):
super().test_fk_ref(connection, metadata, use_composite, tablename, columnname)

0 comments on commit 52ad7b4

Please sign in to comment.