@@ -330,7 +330,7 @@ def create_and_load_types(conn, types_data: list[dict], dialect: str):
330
330
conn .execute (stmt )
331
331
332
332
333
- def create_and_load_postgres_datetz (conn ):
333
+ def create_and_load_postgres_datetz (conn , table_name ):
334
334
from sqlalchemy import (
335
335
Column ,
336
336
DateTime ,
@@ -341,7 +341,7 @@ def create_and_load_postgres_datetz(conn):
341
341
from sqlalchemy .engine import Engine
342
342
343
343
metadata = MetaData ()
344
- datetz = Table ("datetz" , metadata , Column ("DateColWithTz" , DateTime (timezone = True )))
344
+ datetz = Table (table_name , metadata , Column ("DateColWithTz" , DateTime (timezone = True )))
345
345
datetz_data = [
346
346
{
347
347
"DateColWithTz" : "2000-01-01 00:00:00-08:00" ,
@@ -2874,7 +2874,7 @@ def test_datetime_with_timezone_query(conn, request, parse_dates):
2874
2874
# but should be more natural, so coerce to datetime64[ns] for now
2875
2875
conn = request .getfixturevalue (conn )
2876
2876
table_uuid = create_unique_table_name ("datetz" )
2877
- expected = create_and_load_postgres_datetz (conn )
2877
+ expected = create_and_load_postgres_datetz (conn , table_uuid )
2878
2878
2879
2879
# GH11216
2880
2880
df = read_sql_query (f"select * from { table_uuid } " , conn , parse_dates = parse_dates )
@@ -2886,7 +2886,7 @@ def test_datetime_with_timezone_query(conn, request, parse_dates):
2886
2886
def test_datetime_with_timezone_query_chunksize (conn , request ):
2887
2887
conn = request .getfixturevalue (conn )
2888
2888
table_uuid = create_unique_table_name ("datetz" )
2889
- expected = create_and_load_postgres_datetz (conn )
2889
+ expected = create_and_load_postgres_datetz (conn , table_uuid )
2890
2890
2891
2891
df = concat (
2892
2892
list (read_sql_query (f"select * from { table_uuid } " , conn , chunksize = 1 )),
@@ -2900,7 +2900,7 @@ def test_datetime_with_timezone_query_chunksize(conn, request):
2900
2900
def test_datetime_with_timezone_table (conn , request ):
2901
2901
conn = request .getfixturevalue (conn )
2902
2902
table_uuid = create_unique_table_name ("datetz" )
2903
- expected = create_and_load_postgres_datetz (conn )
2903
+ expected = create_and_load_postgres_datetz (conn , table_uuid )
2904
2904
result = sql .read_sql_table (table_uuid , conn )
2905
2905
2906
2906
exp_frame = expected .to_frame ()
0 commit comments