You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example of content we recently shared during support:
dbt commands create most artefacts in the project's target folder, including run_results.json and manifest.json. Since Cosmos creates temporary folders for each dbt command being run, that folder vanishes by the end of the Cosmos task execution, as do the artefacts generated by the command.
However, Cosmos allows users to define custom functions that can run as part of the task execution before deleting the target's folder. They are called callbacks . In addition to describing their own custom callback methods, users can also leverage recently introduced standard functions in Cosmos that allow them to easily upload all the content of the target folder to an object storage (S3, GCS, Blob Storage). We do this by creating paths in the GCS bucket
There are two ways end-users can leverage using Cosmos auxiliary callback functions:
If they use a Cosmos operator (from one of these execution modes: ExecutionMode.LOCAL or ExecutionMode.VIRTUALENV) directly. This is an example using DbtSeedLocalOperator:
I'm attaching a screenshot of the GCS bucket's content, for example (2), but it is similar for (1).
You can see the automatic nesting is:
a) Bucket pre-defined by the user
b) Name of the DAG
c) DAG Run identifier
d) Task ID
e) Task retry identifier
f) Target folder with its contents
Some details that are missing from our documentation:
context about why the target content vanishes, that was the original motivation for callbacks
Rename "Example: Using Callbacks with remote_target_path (Airflow 2.8+)" to Example: Using DbtDag (the current information is an implementation detail)
Illustrate in both examples what data gets uploaded to GCS, with either an ASCII tree or screenshots
explain, in text, what is the default standard hierarchy
give an example of a custom callback
link cosmos/io.py file on Github and mention that users could create their own custom functions based on this, if needed
The text was updated successfully, but these errors were encountered:
We can improve this documentation further:
https://astronomer.github.io/astronomer-cosmos/configuration/callbacks.html
Example of content we recently shared during support:
Some details that are missing from our documentation:
Example: Using DbtDag
(the current information is an implementation detail)cosmos/io.py
file on Github and mention that users could create their own custom functions based on this, if neededThe text was updated successfully, but these errors were encountered: