-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull request for Week 3 #57
base: master
Are you sure you want to change the base?
Conversation
onyekaugochukwu
commented
Sep 5, 2022
- All unit tests passed.
- I created a new branch as suggested
Commit suggestions from Rebecca Sanjabi Co-authored-by: Rebecca Sanjabi <47192430+rsanjabi@users.noreply.github.com>
Updated the Schedules, Sensors and Partitions required for Week 3
stock_high_list = [stock.high for stock in stocks] | ||
highest_stock = float(heapq.nlargest(1,stock_high_list)[0]) | ||
highest_date = stocks[stock_high_list.index(highest_stock)].date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the builtin max
function and define the key
which simplifies this code considerably and removes the heapq dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job finishing week 3!
stock_high_list = [stock.high for stock in stocks] | ||
highest_stock = float(heapq.nlargest(1,stock_high_list)[0]) | ||
highest_date = stocks[stock_high_list.index(highest_stock)].date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment in week1.py
Sorry, I didn't put that comment here.
return { | ||
"resources": { | ||
"s3": { | ||
"config": { | ||
"bucket": "dagster", | ||
"access_key": "test", | ||
"secret_key": "test", | ||
"endpoint_url": "http://host.docker.internal:4566", | ||
} | ||
}, | ||
"redis": { | ||
"config": { | ||
"host": "redis", | ||
"port": 6379, | ||
} | ||
}, | ||
}, | ||
"ops": {"get_s3_data": {"config": {"s3_key": "prefix/stock_{}.csv".format(partition_key)}}}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the following dictionary are essentially the same at the one on lines 67-84. Consider using the docker dict as a starting place and updating just the ops
key to avoid duplication.