44import pandas as pd
55import pytest
66
7- import awswrangler as wr
8-
97from ._utils import ensure_athena_query_metadata
108
119logging .getLogger ("awswrangler" ).setLevel (logging .DEBUG )
1210
1311
14- def test_athena_cache (path , glue_database , glue_table , workgroup1 ):
12+ def test_athena_cache (wr , path , glue_database , glue_table , workgroup1 ):
1513 df = pd .DataFrame ({"c0" : [0 , None ]}, dtype = "Int64" )
1614 wr .s3 .to_parquet (df = df , path = path , dataset = True , mode = "overwrite" , database = glue_database , table = glue_table )
1715
@@ -34,7 +32,7 @@ def test_athena_cache(path, glue_database, glue_table, workgroup1):
3432
3533
3634@pytest .mark .parametrize ("data_source" , [None , "AwsDataCatalog" ])
37- def test_cache_query_ctas_approach_true (path , glue_database , glue_table , data_source ):
35+ def test_cache_query_ctas_approach_true (wr , path , glue_database , glue_table , data_source ):
3836 df = pd .DataFrame ({"c0" : [0 , None ]}, dtype = "Int64" )
3937 wr .s3 .to_parquet (
4038 df = df ,
@@ -70,7 +68,7 @@ def test_cache_query_ctas_approach_true(path, glue_database, glue_table, data_so
7068
7169
7270@pytest .mark .parametrize ("data_source" , [None , "AwsDataCatalog" ])
73- def test_cache_query_ctas_approach_false (path , glue_database , glue_table , data_source ):
71+ def test_cache_query_ctas_approach_false (wr , path , glue_database , glue_table , data_source ):
7472 df = pd .DataFrame ({"c0" : [0 , None ]}, dtype = "Int64" )
7573 wr .s3 .to_parquet (
7674 df = df ,
@@ -105,7 +103,7 @@ def test_cache_query_ctas_approach_false(path, glue_database, glue_table, data_s
105103 ensure_athena_query_metadata (df = df3 , ctas_approach = False , encrypted = False )
106104
107105
108- def test_cache_query_semicolon (path , glue_database , glue_table ):
106+ def test_cache_query_semicolon (wr , path , glue_database , glue_table ):
109107 df = pd .DataFrame ({"c0" : [0 , None ]}, dtype = "Int64" )
110108 wr .s3 .to_parquet (df = df , path = path , dataset = True , mode = "overwrite" , database = glue_database , table = glue_table )
111109
@@ -129,7 +127,7 @@ def test_cache_query_semicolon(path, glue_database, glue_table):
129127 assert df .c0 .sum () == df3 .c0 .sum ()
130128
131129
132- def test_local_cache (path , glue_database , glue_table ):
130+ def test_local_cache (wr , path , glue_database , glue_table ):
133131 wr .config .max_local_cache_entries = 1
134132
135133 df = pd .DataFrame ({"c0" : [0 , None ]}, dtype = "Int64" )
@@ -160,7 +158,7 @@ def test_local_cache(path, glue_database, glue_table):
160158 assert second_query_id in wr .athena ._read ._cache_manager
161159
162160
163- def test_paginated_remote_cache (path , glue_database , glue_table , workgroup1 ):
161+ def test_paginated_remote_cache (wr , path , glue_database , glue_table , workgroup1 ):
164162 wr .config .max_remote_cache_entries = 100
165163 df = pd .DataFrame ({"c0" : [0 , None ]}, dtype = "Int64" )
166164 wr .s3 .to_parquet (df = df , path = path , dataset = True , mode = "overwrite" , database = glue_database , table = glue_table )
@@ -173,7 +171,7 @@ def test_paginated_remote_cache(path, glue_database, glue_table, workgroup1):
173171
174172
175173@pytest .mark .parametrize ("data_source" , [None , "AwsDataCatalog" ])
176- def test_cache_start_query (path , glue_database , glue_table , data_source ):
174+ def test_cache_start_query (wr , path , glue_database , glue_table , data_source ):
177175 df = pd .DataFrame ({"c0" : [0 , None ]}, dtype = "Int64" )
178176 wr .s3 .to_parquet (
179177 df = df ,
0 commit comments