Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions tests/integration/test_sqlalchemy_async_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest
from sqlalchemy import inspect, text
from sqlalchemy.engine.base import Connection, Engine
from sqlalchemy.exc import OperationalError


class TestAsyncFireboltDialect:
Expand Down Expand Up @@ -36,18 +35,6 @@ async def test_data_write(self, async_connection: Connection, fact_table_name: s
)
assert result.rowcount == 1
assert len(result.fetchall()) == 1
# Update not supported
with pytest.raises(OperationalError):
await async_connection.execute(
text(
f"UPDATE {fact_table_name} SET dummy='some_other_text' WHERE idx=1"
)
)
# Delete works but is not officially supported yet
# with pytest.raises(OperationalError):
# await async_connection.execute(
# text(f"DELETE FROM {fact_table_name} WHERE idx=1")
# )

@pytest.mark.asyncio
async def test_set_params(self, async_connection: Engine):
Expand Down
16 changes: 2 additions & 14 deletions tests/integration/test_sqlalchemy_integration.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from datetime import date, datetime
from decimal import Decimal

import pytest
from sqlalchemy import create_engine, text
from sqlalchemy.engine.base import Connection, Engine
from sqlalchemy.exc import OperationalError
from sqlalchemy.types import ARRAY, INTEGER, TypeEngine


Expand Down Expand Up @@ -45,22 +43,12 @@ def test_data_write(self, connection: Connection, fact_table_name: str):
assert result.fetchall() == [(1, "some_text")]
result = connection.execute(text(f"SELECT * FROM {fact_table_name}"))
assert len(result.fetchall()) == 1
# Update not supported
with pytest.raises(OperationalError):
connection.execute(
text(
f"UPDATE {fact_table_name} SET dummy='some_other_text' WHERE idx=1"
)
)
# Delete works but is not officially supported yet
# with pytest.raises(OperationalError):
# connection.execute(f"DELETE FROM {fact_table_name} WHERE idx=1")

def test_firebolt_types(self, connection: Connection):
result = connection.execute(text("SELECT '1896-01-01' :: DATE_EXT"))
result = connection.execute(text("SELECT '1896-01-01' :: PGDATE"))
assert result.fetchall() == [(date(1896, 1, 1),)]
result = connection.execute(
text("SELECT '1896-01-01 00:01:00' :: TIMESTAMP_EXT")
text("SELECT '1896-01-01 00:01:00' :: TIMESTAMPNTZ")
)
assert result.fetchall() == [(datetime(1896, 1, 1, 0, 1, 0, 0),)]
result = connection.execute(text("SELECT 100.76 :: DECIMAL(5, 2)"))
Expand Down