5
5
6
6
import awswrangler as wr
7
7
8
- from ._utils import extract_cloudformation_outputs , get_time_str_with_random_suffix , path_generator
8
+ from ._utils import extract_cloudformation_outputs , get_time_str_with_random_suffix , list_workgroups , path_generator
9
9
10
10
11
11
@pytest .fixture (scope = "session" )
@@ -66,7 +66,7 @@ def loggroup(cloudformation_outputs):
66
66
def workgroup0 (bucket ):
67
67
wkg_name = "aws_data_wrangler_0"
68
68
client = boto3 .client ("athena" )
69
- wkgs = client . list_work_groups ()
69
+ wkgs = list_workgroups ()
70
70
wkgs = [x ["Name" ] for x in wkgs ["WorkGroups" ]]
71
71
if wkg_name not in wkgs :
72
72
client .create_work_group (
@@ -87,7 +87,7 @@ def workgroup0(bucket):
87
87
def workgroup1 (bucket ):
88
88
wkg_name = "aws_data_wrangler_1"
89
89
client = boto3 .client ("athena" )
90
- wkgs = client . list_work_groups ()
90
+ wkgs = list_workgroups ()
91
91
wkgs = [x ["Name" ] for x in wkgs ["WorkGroups" ]]
92
92
if wkg_name not in wkgs :
93
93
client .create_work_group (
@@ -111,7 +111,7 @@ def workgroup1(bucket):
111
111
def workgroup2 (bucket , kms_key ):
112
112
wkg_name = "aws_data_wrangler_2"
113
113
client = boto3 .client ("athena" )
114
- wkgs = client . list_work_groups ()
114
+ wkgs = list_workgroups ()
115
115
wkgs = [x ["Name" ] for x in wkgs ["WorkGroups" ]]
116
116
if wkg_name not in wkgs :
117
117
client .create_work_group (
@@ -135,7 +135,7 @@ def workgroup2(bucket, kms_key):
135
135
def workgroup3 (bucket , kms_key ):
136
136
wkg_name = "aws_data_wrangler_3"
137
137
client = boto3 .client ("athena" )
138
- wkgs = client . list_work_groups ()
138
+ wkgs = list_workgroups ()
139
139
wkgs = [x ["Name" ] for x in wkgs ["WorkGroups" ]]
140
140
if wkg_name not in wkgs :
141
141
client .create_work_group (
@@ -199,6 +199,7 @@ def glue_table(glue_database):
199
199
wr .catalog .delete_table_if_exists (database = glue_database , table = name )
200
200
yield name
201
201
wr .catalog .delete_table_if_exists (database = glue_database , table = name )
202
+ print (f"Table { glue_database } .{ name } deleted." )
202
203
203
204
204
205
@pytest .fixture (scope = "function" )
0 commit comments