- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 228
feat: add support for lists of basic python types #165
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
Codecov Report
@@ Coverage Diff @@
## main #165 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 1264 1276 +12
=========================================
+ Hits 1264 1276 +12
Continue to review full report at Codecov.
|
Awesome, thanks for the contribution 😃! We do try to keep 100% unit test coverage as well as add end to end tests where feasible. General info should be in the CONTRIBUTING.md (though I just realized the layout is a bit misleading). In this case since your changes are in You'll also want to cover the new For the end to end tests, right now it's all based on a FastAPI app. The easiest thing to do would be to create a new endpoint which returns a basic list response, then run Finally, stick a summary of your addition in a bullet in CHANGELOG.md, feel free to include a |
Hi, thanks for the detailed response. I hadn't the time last week but I'll make sure to write the tests and documentation changes required next week. FastAPI is fine, that's what we use for our projects anyway. |
Added support for lists of strings, floats, integers and booleans.
I've implemented the unit and e2e tests, and added a note in the CHANGELOG.md now. I also rebased on the latest changes on the I guess there shouldn't be any other changes, such as documentation, required? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for all your work on this @Maistho!
response = httpx.get(url=url, headers=headers,) | ||
|
||
if response.status_code == 200: | ||
return [str(item) for item in cast(List[str], response.json())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need the cast
here since we're converting to the correct type with str
. I suppose it doesn't hurt though, so we can leave it in.
Adds support for lists of strings/numbers etc
Let me know if there should be some test changes or such. I haven't contributed to this repository before, so I'd appreciate some pointers if so. :)