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

Use objects qualified name in caching #269

Merged
merged 4 commits into from
May 22, 2022
Merged

Conversation

bdilday
Copy link
Contributor

@bdilday bdilday commented May 20, 2022

This adds a CI stage to illustrate the problem mentioned here #267 #221
namely that when the cache is enabled, the call to get the fangraphs batting and pitching stats return the same dataframe.

@bdilday bdilday changed the title validate cache CI step Use objects qualified name in caching May 21, 2022
@bdilday
Copy link
Contributor Author

bdilday commented May 21, 2022

Updated the MR to include a proposed fix for the issue of batting and pitching stats returning the same dataframe.

  • moves the cache decorator for the fetch method from the abstract base class FangraphsDataTable to the concrete classes FangraphsBattingStatsTable, FangraphsFieldingStatsTable, FangraphsPitchingStatsTable

this means the fully qualified name will include the concrete class name (e.g. FangraphsBattingStatsTable.fetch) not the base class (e.g. FangraphsDataTable.fetch

  • when hashing the function name for caching, uses the fully qualified name (if it doesn't contain <locals>) instead of just the name. this means it will be e.g. FangraphsBattingStatsTable.fetch instead of fetch

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