Closed armstjc closed 2 years ago
This is effectively a duplicate of #221. I was unable to reproduce, but seems like others are running into it as well. @schorrm - any thoughts here?
I took a look at it and I was able to reproduce it (using pybaseball.cache.enable()
as shown in the example above).
It seems to me that the caching is unable to distinguish between the two calls. I speculate that it has to do with they're both calling the fetch
method
https://github.com/jldbc/pybaseball/blob/master/pybaseball/datasources/fangraphs.py#L224-L226
of classes that are derived from the FangraphsDataTable
(abstract) class
https://github.com/jldbc/pybaseball/blob/master/pybaseball/datasources/fangraphs.py#L76-L81
I have 2 guesses of what might fix it:
fetch
method to each of the derived classes so the caching can recognize it's a different callbut honestly I don't have a strong understanding of the caching so I don;t really know.
When running the following code:
It does not get the pitching stats as intended, as shown below: