I'm trying to write code that iterates over segment efforts. I'm trying to do something like this:
efforts = client.get_segment_efforts(segment_id, athlete_id, since, to)
for effort in efforts:
print(effort)
# I've also tried:
print("Number retrieved:", len(list(efforts)))
Both of these give me the error:
FAILED (errors=1)
No rates present in response headers
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/stravalib/client.py", line 2038, in _fill_buffer
new_entity = self.entity.parse_obj(
^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__
File "pydantic/main.py", line 1074, in pydantic.main.validate_model
File "pydantic/fields.py", line 857, in pydantic.fields.ModelField.validate
pydantic.errors.ConfigError: field "activity" not yet prepared so type is still a ForwardRef, you might need to call BaseEffort.update_forward_refs().
I've searched the web and found zero examples of using the BatchedResultsIterator object returned. Zero. The code that works, doesn't use the Strava Python API and just uses the requests library. The one semi example that I found was here: https://pythonhosted.org/stravalib/usage/overview.html
And had this code, which generates the same error for me:
activities = client.get_activities(limit=10)
assert len(list(activities)) == 10
Also concerning is the error "No rates present in response headers". What does that mean?
Bill