-
Couldn't load subscription status.
- Fork 21
fix: include falsy but valid parameter values (e.g. 0, False) in payload #49
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
Conversation
|
There is 1 failing test but that test failed when I forked the main branch and fails for an unrelated reason. I did not investigate the failure. |
|
it's also worth noting that there are other functions that built the payload in a similar way but I was not familiar with those end points to know what was valid and what wasn't, so I did not attempt to fix them. |
|
Thanks @abelsm2, I appreciate the catch. One thing I'd love to do at some point is properly add some type safety to the whole project – really define what goes in and out of each method. Just one of those things I never get around to, but would help to avoid bugs like this being possible. I've taken a look at the other place that this happens and it could benefit from your same fix, would you mind putting it in place for that? I've also just merged #50, which will help to ensure you get some ticks on the tests flow at least. |
|
On that note, it would be a decent shout to add some test coverage for this particular bug – ensure that things like your examples of race_week_num=0 or official_only=False make it through to the request. |
|
sure thing, I can add this fix to the other function that had the same bug. I did add a new test to verify that |
f0b8507 to
e79f17a
Compare
00394a9 to
65899b2
Compare
e79f17a to
82f8472
Compare
65899b2 to
bc7c245
Compare
|
Apologies for all the activity on here – I cannot understand why the labeller won't work. It's not particularly important, but it should just work. |
|
Git can be a pain eh?! Here's what I'd do if you want, although I'm far from expert. On your local:
Potentially you could change step 5 to: Either of those options should get you close to a nice clean commit history again without the conflicts. |
|
Yes, sorry about this. I admittedly have no idea what I'm doing when it comes to PR and most of the more interesting ways to deal with git. This repo is the 1st and only one I have ever contributed to where I was not the only developer. Hopefully the rebase and push will resolve the conflicts. |
|
Don't you worry about it at all @abelsm2, up until relatively recently I was very similar - very much so when starting this repo too. It's only a change to a more specific professional role that's given me any clue at all. I hope the difficulties of PRs like this are useful to you either way, but if it feels like a pain at some point let me know and I'm happy to just sort it out somehow. No need to apologise at all, really appreciate the fact you bother to help 👍 |
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
Nope, this is a good learning experience! Hopefully that last push got it. |
Previously, the payload builder filtered parameters using a truthiness check (
if params[x]:). This unintentionally excluded valid values such asrace_week_num=0orofficial_only=False.Updated the logic to only exclude parameters that are explicitly
None, ensuring falsy but valid values are preserved in the payload. Added new testtest_result_search_series_with_race_week_num_0()to verify fix.Fixes #48.