Skip to content

Commit

Permalink
Mention in docs callback support for ExecutionMode.VIRTUALENV
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajkoti committed Dec 18, 2024
1 parent ef156be commit 9a8887f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions dev/dags/example_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ def example_virtualenv() -> None:
"py_requirements": ["dbt-postgres"],
"install_deps": True,
"emit_datasets": False, # Example of how to not set inlets and outlets
# --------------------------------------------------------------------------
# Callback function to upload files using Airflow Object storage and Cosmos remote_target_path setting on
# Airflow 2.8 and above
# "callback": upload_to_cloud_storage,
# --------------------------------------------------------------------------
# Callback function if you'd like to upload files from the target directory to remote store e.g. AWS S3 that
# works with Airflow < 2.8 too
# "callback": upload_to_aws_s3,
# "callback_args": {"aws_conn_id": "aws_s3_conn", "bucket_name": "cosmos-artifacts-upload"}
# --------------------------------------------------------------------------
},
)

Expand Down
9 changes: 5 additions & 4 deletions docs/configuration/callbacks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Callbacks
=========

Cosmos supports callback functions that execute at the end of a task's execution when using ``ExecutionMode.LOCAL``.
Cosmos supports callback functions that execute at the end of a task's execution when using ``ExecutionMode.LOCAL`` and
``ExecutionMode.VIRTUALENV``.
These callbacks can be used for various purposes, such as uploading files from the target directory to remote
storage. While this feature has been available for some time, users may not be fully aware of its capabilities.

Expand Down Expand Up @@ -46,6 +47,6 @@ metadata.
Limitations and Contributions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Currently, callback support is available only when using ``ExecutionMode.LOCAL``. Contributions to extend this
functionality to other execution modes are welcome and encouraged. You can reference the implementation for
``ExecutionMode.LOCAL`` to add support for other modes.
Currently, callback support is available only when using ``ExecutionMode.LOCAL`` and ``ExecutionMode.VIRTUALENV``.
Contributions to extend this functionality to other execution modes are welcome and encouraged. You can reference the
implementation for ``ExecutionMode.LOCAL`` to add support for other modes.

0 comments on commit 9a8887f

Please sign in to comment.