Skip to content

Commit

Permalink
Adding numerical metadata to taxi_trips_file
Browse files Browse the repository at this point in the history
  • Loading branch information
odette-elementl committed Jul 17, 2023
1 parent 47245f0 commit 5cc3e50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dagster_university/assets/trips.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dagster import asset
from dagster import asset, MetadataValue
from dagster_duckdb import DuckDBResource

import requests
Expand Down Expand Up @@ -64,6 +64,8 @@ def taxi_trips_file(context):

with open(constants.TAXI_TRIPS_TEMPLATE_FILE_PATH.format(month_to_fetch), "wb") as output_file:
output_file.write(raw_trips.content)
context.add_output_metadata({'Number of records': MetadataValue.int(len(raw_trips.content))})


## Lesson 4, 8, 6
@asset(
Expand Down

0 comments on commit 5cc3e50

Please sign in to comment.