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

Adding Venue details for schedule #41

Merged
merged 3 commits into from
Jul 18, 2020
Merged

Conversation

ryancheley
Copy link
Contributor

I added in the ID and Name of the Venue from the schedule API. I'm not sure how to run the tests for this (but am willing to learn!).

If there's more that's needed from me on this, please let me know and I'll make necessary changes.

Thanks!

Copy link
Owner

@toddrob99 toddrob99 left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution. I will be happy to include this in the next version, but can you please update ' to " and use .get() to ensure the method will not throw an exception in case the venue data is missing? MLB has a habit of inexplicable data discrepancies, so it's best to guard against missing elements.

This will return None for both if the venue element is missing:

                    "venue_id": game.get("venue", {}).get("id"),
                    "venue_name": game.get("venue", {}).get("name"),

@toddrob99 toddrob99 changed the base branch from master to develop July 18, 2020 17:34
@toddrob99 toddrob99 self-assigned this Jul 18, 2020
@toddrob99 toddrob99 added the enhancement New feature or request label Jul 18, 2020
@toddrob99 toddrob99 linked an issue Jul 18, 2020 that may be closed by this pull request
@ryancheley
Copy link
Contributor Author

Updated to use .get() and replaced ' with "

@toddrob99 toddrob99 merged commit 696b87c into toddrob99:develop Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Venue ID and Venue Name to schedule method
2 participants