Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

onyekaugochukwu
Copy link

  • All unit tests passed.
  • I created a new branch as suggested

Comment on lines +59 to +61
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
Copy link

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.

Copy link

@czroth czroth left a 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!

Comment on lines +39 to +41
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
Copy link

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.

Comment on lines +90 to +108
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)}}},
}
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants