opeida commented on issue #51909:
URL: https://github.com/apache/airflow/issues/51909#issuecomment-2992438392

   @jroachgolf84 I initialize `ObjectStoragePath` at the top-level and pass it 
to most of the tasks to pass data between them.
   
   ```python
   base = ObjectStoragePath("gs://{{ var.json.GCP_CONFIG.GCS_TEMP_BUCKET }}", 
conn_id="gcp-adders-automation")
   
   ...
       generate_uuid = PythonOperator(
           task_id="generate_uuid", python_callable=lambda: str(uuid4())
       )
   
       @task
       def get_stats_data(
           output_path: ObjectStoragePath,
           **context
       ) -> ObjectStoragePath | None:
           ...
           output_path /= f"{context.get('ti').task_id}.csv"
           with output_path.open("w") as file:
               data.to_csv(file, index=False)
           return output_path
   ...
       stats_data = get_stats_data(output_path=base/generate_uuid.output)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to