Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs update: retries note about Dagbag error. #592

Merged
merged 11 commits into from
Oct 13, 2023
1 change: 1 addition & 0 deletions dev/dags/basic_cosmos_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="basic_cosmos_dag",
default_args={"retries": 2},
)
# [END local_example]
3 changes: 2 additions & 1 deletion dev/dags/basic_cosmos_task_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


@dag(
schedule_interval="@daily",
schedule="@daily",
tatiana marked this conversation as resolved.
Show resolved Hide resolved
start_date=datetime(2023, 1, 1),
catchup=False,
)
Expand All @@ -42,6 +42,7 @@ def basic_cosmos_task_group() -> None:
),
operator_args={"install_deps": True},
profile_config=profile_config,
default_args={"retries": 2},
)

post_dbt = EmptyOperator(task_id="post_dbt")
Expand Down
3 changes: 2 additions & 1 deletion dev/dags/cosmos_manifest_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
render_config=RenderConfig(load_method=LoadMode.DBT_MANIFEST, select=["path:models/customers.sql"]),
operator_args={"install_deps": True},
# normal dag parameters
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="cosmos_manifest_example",
default_args={"retries": 2},
)
# [END local_example]
3 changes: 2 additions & 1 deletion dev/dags/cosmos_profile_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


@dag(
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
)
Expand All @@ -41,6 +41,7 @@ def cosmos_profile_mapping() -> None:
),
),
operator_args={"install_deps": True},
default_args={"retries": 2},
)

post_dbt = EmptyOperator(task_id="post_dbt")
Expand Down
2 changes: 1 addition & 1 deletion dev/dags/cosmos_seed_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
doc_md=__doc__,
catchup=False,
max_active_runs=1,
default_args={"owner": "01-EXTRACT"},
default_args={"owner": "01-EXTRACT", "retries": 2},
) as dag:
with TaskGroup(group_id="drop_seeds_if_exist") as drop_seeds:
for seed in ["raw_customers", "raw_payments", "raw_orders"]:
Expand Down
3 changes: 2 additions & 1 deletion dev/dags/dbt_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ def which_upload():
with DAG(
dag_id="docs_dag",
start_date=datetime(2023, 1, 1),
schedule_interval="@daily",
schedule="@daily",
doc_md=__doc__,
catchup=False,
default_args={"retries": 2},
) as dag:
generate_dbt_docs_aws = DbtDocsS3Operator(
task_id="generate_dbt_docs_aws",
Expand Down
3 changes: 2 additions & 1 deletion dev/dags/example_cosmos_python_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
"append_env": True,
},
# normal dag parameters
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="example_cosmos_python_models",
default_args={"retries": 2},
)
# [END example_cosmos_python_models]
3 changes: 2 additions & 1 deletion dev/dags/example_model_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
profile_config=profile_config,
operator_args={"install_deps": True},
# normal dag parameters
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="example_model_version",
default_args={"retries": 2},
)
# [END local_example]
3 changes: 2 additions & 1 deletion dev/dags/example_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
"install_deps": True,
},
# normal dag parameters
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="example_virtualenv",
default_args={"retries": 2},
)
# [END virtualenv_example]
3 changes: 2 additions & 1 deletion dev/dags/user_defined_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


@dag(
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
)
Expand All @@ -36,6 +36,7 @@ def user_defined_profile() -> None:
profiles_yml_filepath=PROFILES_FILE_PATH,
),
operator_args={"append_env": True, "install_deps": True},
default_args={"retries": 2},
)

post_dbt = EmptyOperator(task_id="post_dbt")
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/scheduling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To schedule a dbt project on a time-based schedule, you can use Airflow's schedu
jaffle_shop = DbtDag(
# ...
start_date=datetime(2023, 1, 1),
schedule_interval="@daily",
schedule="@daily",
)


Expand Down Expand Up @@ -45,7 +45,7 @@ Then, you can use Airflow's data-aware scheduling capabilities to schedule ``my_
project_one = DbtDag(
# ...
start_date=datetime(2023, 1, 1),
schedule_interval="@daily",
schedule="@daily",
)

project_two = DbtDag(
Expand Down
7 changes: 6 additions & 1 deletion docs/getting_started/astro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,17 @@ In your ``my_cosmos_dag.py`` file, import the ``DbtDag`` class from Cosmos and c
dbt_executable_path=f"{os.environ['AIRFLOW_HOME']}/dbt_venv/bin/dbt",
),
# normal dag parameters
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="my_cosmos_dag",
default_args={"retries": 2},
)

.. note::
In some cases, especially in projects containing a large number of DAGs, you might run into an error saying ``<> is not a valid ResourceType``.
tatiana marked this conversation as resolved.
Show resolved Hide resolved
The recommended solution is to use the Cosmos manifest parsing method `dbt_manifest <https://astronomer.github.io/astronomer-cosmos/configuration/parsing-methods.html#dbt-manifest>`_.
Alternatively, the error can be resolved by increasing the value of the Airflow configuration `core.dagbag_import_timeout <https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#dagbag-import-timeout>`_.

Start your project
~~~~~~~~~~~~~~~~~~
Expand Down
9 changes: 8 additions & 1 deletion docs/getting_started/gcc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ Make sure to rename the ``<your-adapter>`` value below to your adapter's Python
"py_requirements": ["<your-adapter>"],
},
# normal dag parameters
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="my_cosmos_dag",
default_args={"retries": 2},
)


.. note::
In some cases, especially in projects containing a large number of DAGs, you might run into an error saying ``<> is not a valid ResourceType``.
The recommended solution is to use the Cosmos manifest parsing method `dbt_manifest <https://astronomer.github.io/astronomer-cosmos/configuration/parsing-methods.html#dbt-manifest>`_.
Alternatively, the error can be resolved by increasing the value of the Airflow configuration `core.dagbag_import_timeout <https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#dagbag-import-timeout>`_.
2 changes: 1 addition & 1 deletion docs/getting_started/kubernetes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Additional KubernetesPodOperator parameters can be added on the operator_args pa

For instance,

.. code-block:: text
.. code-block:: python

run_models = DbtTaskGroup(
profile_config=ProfileConfig(
Expand Down
9 changes: 8 additions & 1 deletion docs/getting_started/mwaa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,15 @@ In your ``my_cosmos_dag.py`` file, import the ``DbtDag`` class from Cosmos and c
),
profile_config=profile_config,
# normal dag parameters
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="my_cosmos_dag",
default_args={"retries": 2},
)


.. note::
In some cases, especially in projects containing a large number of DAGs, you might run into an error saying ``<> is not a valid ResourceType``.
The recommended solution is to use the Cosmos manifest parsing method `dbt_manifest <https://astronomer.github.io/astronomer-cosmos/configuration/parsing-methods.html#dbt-manifest>`_.
Alternatively, the error can be resolved by increasing the value of the Airflow configuration `core.dagbag_import_timeout <https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#dagbag-import-timeout>`_.
9 changes: 8 additions & 1 deletion docs/getting_started/open-source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@ For example, if you wanted to put your dbt project in the ``/usr/local/airflow/d
dbt_executable_path=f"{os.environ['AIRFLOW_HOME']}/dbt_venv/bin/dbt",
),
# normal dag parameters
schedule_interval="@daily",
schedule="@daily",
start_date=datetime(2023, 1, 1),
catchup=False,
dag_id="my_cosmos_dag",
default_args={"retries": 2},
)


.. note::
In some cases, especially in projects containing a large number of DAGs, you might run into an error saying ``<> is not a valid ResourceType``.
The recommended solution is to use the Cosmos manifest parsing method `dbt_manifest <https://astronomer.github.io/astronomer-cosmos/configuration/parsing-methods.html#dbt-manifest>`_.
Alternatively, the error can be resolved by increasing the value of the Airflow configuration `core.dagbag_import_timeout <https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#dagbag-import-timeout>`_.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ You can render an Airflow Task Group using the ``DbtTaskGroup`` class. Here's an
dbt_tg = DbtTaskGroup(
project_config=ProjectConfig("jaffle_shop"),
profile_config=profile_config,
default_args={"retries": 2},
)

e2 = EmptyOperator(task_id="post_dbt")
Expand Down
Loading