Skip to content
Merged
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
Prev Previous commit
Next Next commit
Update sqlalchemy e2e tests to get valid signal after parameterized q…
…ueries were implemented in DBR

Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
  • Loading branch information
Jesse Whitehouse
Jesse Whitehouse committed Sep 26, 2023
commit 158abc60109e5d11c76f8a7398a158e9237275eb
8 changes: 6 additions & 2 deletions tests/e2e/sqlalchemy/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def test_connect_args(db_engine):


@pytest.mark.skipif(sqlalchemy_1_3(), reason="Pandas requires SQLAlchemy >= 1.4")
@pytest.mark.skip(reason="DBR is currently limited to 256 parameters per call to .execute(). Test cannot pass.")
def test_pandas_upload(db_engine, metadata_obj):

import pandas as pd
Expand Down Expand Up @@ -170,7 +171,8 @@ def test_bulk_insert_with_core(db_engine, metadata_obj, session):

import random

num_to_insert = random.choice(range(10_000, 20_000))
# Maximum number of parameter is 256. 256/4 == 64
num_to_insert = 64

table_name = "PySQLTest_{}".format(datetime.datetime.utcnow().strftime("%s"))

Expand All @@ -181,7 +183,7 @@ def test_bulk_insert_with_core(db_engine, metadata_obj, session):
)

rows = [
{"name": names[i % 3], "number": random.choice(range(10000))}
{"name": names[i % 3], "number": random.choice(range(64))}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary because DBSQL can only accept 255 parameters per execution, right now.

for i in range(num_to_insert)
]

Expand All @@ -193,6 +195,7 @@ def test_bulk_insert_with_core(db_engine, metadata_obj, session):
assert len(rows) == num_to_insert


@pytest.mark.skip(reason="Parameterized query implementation cannot work with Decimal types yet.")
def test_create_insert_drop_table_core(base, db_engine, metadata_obj: MetaData):
""" """

Expand Down Expand Up @@ -264,6 +267,7 @@ class SampleObject(base):
base.metadata.drop_all()


@pytest.mark.skip(reason="Parameterized query implementation cannot work with Decimal types yet.")
def test_dialect_type_mappings(base, db_engine, metadata_obj: MetaData):
"""Confirms that we get back the same time we declared in a model and inserted using Core"""

Expand Down