You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by pa...@apache.org on 2023/10/26 10:10:34 UTC
[airflow] branch main updated: Update datasets.rst issue with running example code (#35035)
This is an automated email from the ASF dual-hosted git repository.
pankaj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 8e26894073 Update datasets.rst issue with running example code (#35035)
8e26894073 is described below
commit 8e268940739154c21aaf40441d91dac806d21a60
Author: Erik Farmer <50...@users.noreply.github.com>
AuthorDate: Thu Oct 26 03:10:26 2023 -0700
Update datasets.rst issue with running example code (#35035)
dataset list is a list so running `print(dataset, dataset_list, dataset_list[dataset])` causes a `TypeError: list indices must be integers or slices, not str`
lastly that attribute name should be `dag_id` and not `dag_run_id`
---
docs/apache-airflow/authoring-and-scheduling/datasets.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/apache-airflow/authoring-and-scheduling/datasets.rst b/docs/apache-airflow/authoring-and-scheduling/datasets.rst
index 60268bedff..2cc34d9c88 100644
--- a/docs/apache-airflow/authoring-and-scheduling/datasets.rst
+++ b/docs/apache-airflow/authoring-and-scheduling/datasets.rst
@@ -230,8 +230,8 @@ Example:
@task
def print_triggering_dataset_events(triggering_dataset_events=None):
for dataset, dataset_list in triggering_dataset_events.items():
- print(dataset, dataset_list, dataset_list[dataset])
- print(dataset_list[dataset][0].source_dag_run.dag_run_id)
+ print(dataset, dataset_list)
+ print(dataset_list[0].source_dag_run.dag_id)
print_triggering_dataset_events()