Skip to content

Commit

Permalink
Update datasets.rst issue with running example code (#35035)
Browse files Browse the repository at this point in the history
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`

(cherry picked from commit 8e26894)
  • Loading branch information
erik-farmer authored and ephraimbuddy committed Oct 30, 2023
1 parent a42206e commit 21aeadd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/apache-airflow/authoring-and-scheduling/datasets.rst
Expand Up @@ -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()
Expand Down

0 comments on commit 21aeadd

Please sign in to comment.