Skip to content

Commit c09548e

Browse files
abelsm2claude
authored andcommitted
fix: include falsy but valid parameter values (e.g. 0, False) in payload
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 8aee25e commit c09548e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/iracingdataapi/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -800,9 +800,9 @@ def result_search_hosted(
800800

801801
params = locals()
802802
payload = {}
803-
for x in params.keys():
804-
if x != "self" and params[x]:
805-
payload[x] = params[x]
803+
for x, val in params.items():
804+
if x != "self" and val is not None:
805+
payload[x] = val
806806

807807
resource = self._get_resource("/data/results/search_hosted", payload=payload)
808808
return self._get_chunks(resource.get("data", dict()).get("chunk_info"))
@@ -861,9 +861,9 @@ def result_search_series(
861861

862862
params = locals()
863863
payload = {}
864-
for x in params.keys():
865-
if x != "self" and params[x]:
866-
payload[x] = params[x]
864+
for x, val in params.items():
865+
if x != "self" and val is not None:
866+
payload[x] = val
867867

868868
resource = self._get_resource("/data/results/search_series", payload=payload)
869869
return self._get_chunks(resource.get("data", dict()).get("chunk_info"))

0 commit comments

Comments
 (0)