8000 TST: Make test_sql.py parallelizable by UmbertoFasci · Pull Request #60595 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

TST: Make test_sql.py parallelizable #60595

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

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
0fe741b
Make test_sql.py all_connectable tests parallelizable
UmbertoFasci Dec 8, 2024
60f1a14
Make test_sql.py sqlalchemy_connectable tests parallelizable
UmbertoFasci Dec 9, 2024
cc35414
Make test_sql.py postgresql_connectable tests parallelizable
UmbertoFasci Dec 9, 2024
ecb6c4d
make test_sql.py mysql_connectable tests parallelizable
UmbertoFasci Dec 9, 2024
0c51e04
Make test_sql.py sqlite_engine tests parallelizable
UmbertoFasci Dec 19, 2024
17cf723
Make test_sql.py sqlite_conn tests parallelizable
UmbertoFasci Dec 19, 2024
4147a77
Make test_sql.py other connectable tests parallelizable
UmbertoFasci Dec 20, 2024
5250e1b
Make test_sql.py other connectable tests parallelizable 2
UmbertoFasci Dec 20, 2024
6d73fa0
Make test_sql.py other connectable tests parallelizable 3
UmbertoFasci Dec 20, 2024
9c9f7e7
Merge branch 'main' into make_parallelizable
UmbertoFasci Dec 20, 2024
a354c59
Remove single CPU marker and update table name creation function name
UmbertoFasci Dec 20, 2024
b18c79c
resolve test_api_to_sql_index_label_multiindex error
UmbertoFasci Dec 20, 2024
2a856db
resolve tests which create table with create_and_load_postgres_datetz
UmbertoFasci Dec 20, 2024
7a31438
resolve regex error for test_xsqlite_if_exists
UmbertoFasci Dec 20, 2024
b5a60d9
resolve sqlalchemy reflection drop_table race condition
UmbertoFasci Dec 21, 2024
be28090
resolve drop_table sqlalchemy reflection error handling
UmbertoFasci Dec 21, 2024
e62a848
revert drop_table error handling
UmbertoFasci Dec 21, 2024
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
revert drop_table error handling
  • Loading branch information
UmbertoFasci committed Dec 21, 2024
commit e62a8480533c74efa9c8b74f1aa01ca3fbd8b60c
19 changes: 9 additions & 10 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ def create_and_load_postgres_datetz(conn, table_name):
from sqlalchemy.engine import Engine

metadata = MetaData()
datetz = Table(table_name, metadata, Column("DateColWithTz", DateTime(timezone=True)))
datetz = Table(
table_name, metadata, Column("DateColWithTz", DateTime(timezone=True))
)
datetz_data = [
{
"DateColWithTz": "2000-01-01 00:00:00-08:00",
Expand Down Expand Up @@ -565,8 +567,6 @@ def drop_table(
table_name: str,
conn: sqlite3.Connection | sqlalchemy.engine.Engine | sqlalchemy.engine.Connection,
):
import sqlalchemy

if isinstance(conn, sqlite3.Connection):
conn.execute(f"DROP TABLE IF EXISTS {sql._get_valid_sqlite_name(table_name)}")
conn.commit()
Expand All @@ -577,12 +577,9 @@ def drop_table(
with conn.cursor() as cur:
cur.execute(f'DROP TABLE IF EXISTS "{table_name}"')
else:
try:
with conn.begin() as con:
with sql.SQLDatabase(con) as db:
db.drop_table(table_name)
except sqlalchemy.exc.ProgrammingError:
pass
with conn.begin() as con:
with sql.SQLDatabase(con) as db:
db.drop_table(table_name)


def drop_view(
Expand Down Expand Up @@ -3974,7 +3971,9 @@ def test_psycopg2_schema_support(postgresql_psycopg2_engine):
con.exec_driver_sql("CREATE SCHEMA other;")

schema_public_uuid = create_unique_table_name("test_schema_public")
schema_public_explicit_uuid = create_unique_table_name("test_schema_public_explicit")
schema_public_explicit_uuid = create_unique_table_name(
"test_schema_public_explicit"
)
schema_other_uuid = create_unique_table_name("test_schema_other")

# write dataframe to different schema's
Expand Down
Loading
0