Skip to content

Commit

Permalink
Dagster University: Remove redundant MetadataValue in Dagster Essenti…
Browse files Browse the repository at this point in the history
…als Course (#20288)

## Summary & Motivation
In "Extra credit: Metadata" of the Dagster Essentials course, the row
count is being wrapped in a MetadataValue twice, once when the rows are
counted, and once in the MaterializeResult definition, resulting in this
error:

`Param "value" is not a int.`
`Got IntMetadataValue(value=263) which is type <class
'dagster._core.definitions.metadata.IntMetadataValue'>.`

## How I Tested These Changes
Ran the example with the redundant MetadataValue removed
  • Loading branch information
stianthaulow committed Mar 6, 2024
1 parent 4e28143 commit 644a46c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def taxi_zones_file():

with open(constants.TAXI_ZONES_FILE_PATH, "wb") as output_file:
output_file.write(raw_taxi_zones.content)
num_rows = MetadataValue.int(len(pd.read_csv(constants.TAXI_ZONES_FILE_PATH)))
num_rows = len(pd.read_csv(constants.TAXI_ZONES_FILE_PATH))

return MaterializeResult(
metadata={
Expand Down

1 comment on commit 644a46c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagster-university ready!

✅ Preview
https://dagster-university-ewbpl9arm-elementl.vercel.app

Built with commit 644a46c.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.