nba-sql
nba-sql copied to clipboard
Larger calls fail even with time-between-requests
I get the error below anytime I try to pull a larger dataset. I tried to use the time-between-requests to address, but it still fails at random points. I tried to pull the data in chucks but then run into issues with duplicate keys.
Traceback (most recent call last):---------------------| 13.0% File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/steve/Projects/nba-sql/stats/nba_sql.py", line 398, in
Do you still get this error? Sometimes the NBA's API fails and only returns partial data, I'm not sure if this is a form of rate limiting or not.