Skip to content

Commit

Permalink
Update datasets.rst issue with running example code (apache#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`
  • Loading branch information
erik-farmer authored Oct 26, 2023
1 parent ba28334 commit 8e26894
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/apache-airflow/authoring-and-scheduling/datasets.rst
Original file line number Diff line number Diff line change
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 8e26894

Please sign in to comment.