Laura Vaida
07/06/2021, 7:48 AM@task(log_stdout=True)
def write_order_data (dataframe):
current_date = dt.today().strftime("%Y_%m_%d")
#GCS_Result = GCSResult(bucket='uwg-mail', location = 'orders_import_sf' + '_' + current_date + '.csv')
dataframe.to_csv('<gs://uwg-mail/orders_import_sf.csv>', dataframe, header=True)
Marko Herkaliuk
07/06/2021, 9:07 AMMarko Herkaliuk
07/06/2021, 9:08 AM@task(
result=S3Result(
bucket="",
boto3_kwargs={
"aws_access_key_id": "",
"aws_secret_access_key": "",
"endpoint_url": ""
},
location=f".csv"
)
)
here s3 exampleLaura Vaida
07/06/2021, 1:13 PMKevin Kho
to_csv
call right? `
dataframe.to_csv('<gs://uwg-mail/orders_import_sf.csv>', dataframe, header=True)
You shouldn’t need to pass dataframe here right?Marko Herkaliuk
07/06/2021, 1:52 PMwith the to_csv method i have to define a path rightaway.no, u don’t just make
return df.to_csv(index=False)
and path put in resultLaura Vaida
07/07/2021, 7:59 AM@task(log_stdout=True)
def write_order_data (dataframe):
dataframe.to_csv('<gs://xyz/file.csv>', header=True, storage_options = {"token" : Secret("GCP_CREDENTIALS").get()})