@@ -25,9 +25,9 @@ def main():
2525 help = "desired logging level (set to error by default)" ,
2626 )
2727 # Options specific to this sample
28- parser .add_argument ("--create" , action = "store_true" )
28+ parser .add_argument ("--create" , action = "store_true" )
2929 parser .add_argument ("--delete" , action = "store_true" )
30- parser .add_argument ("--refresh" , action = "store_true" )
30+ parser .add_argument ("--refresh" , action = "store_true" )
3131 parser .add_argument ("--workbook" , required = False )
3232 parser .add_argument ("--datasource" , required = False )
3333 args = parser .parse_args ()
@@ -43,7 +43,7 @@ def main():
4343 server .use_server_version ()
4444 with server .auth .sign_in (tableau_auth ):
4545
46- wb = None
46+ wb = None
4747 ds = None
4848 if args .workbook :
4949 wb = server .workbooks .get_by_id (args .workbook )
@@ -53,7 +53,7 @@ def main():
5353 ds = server .datasources .get_by_id (args .datasource )
5454 if ds is None :
5555 raise ValueError (f"Datasource not found for id { args .datasource } " )
56- else :
56+ else :
5757 # Gets all workbook items
5858 all_workbooks , pagination_item = server .workbooks .get ()
5959 print (f"\n There are { pagination_item .total_available } workbooks on site: " )
@@ -67,20 +67,19 @@ def main():
6767 print ("create extract on wb " , wb .name )
6868 extract_job = server .workbooks .create_extract (wb , includeAll = True )
6969 print (extract_job )
70-
70+
7171 if args .refresh :
7272 extract_job = None
73- if ds is not None :
73+ if ds is not None :
7474 print (f"refresh extract on datasource { ds .name } " )
7575 extract_job = server .datasources .refresh (ds , includeAll = True , incremental = True )
7676 elif wb is not None :
7777 print (f"refresh extract on workbook { wb .name } " )
7878 extract_job = server .workbooks .refresh (wb )
79- else :
79+ else :
8080 print ("no content item selected to refresh" )
81-
81+
8282 print (extract_job )
83-
8483
8584 if args .delete :
8685 print ("delete extract on wb " , wb .name )
0 commit comments