Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

requests wrapper #2367

Merged
merged 3 commits into from Apr 4, 2023
Merged

requests wrapper #2367

merged 3 commits into from Apr 4, 2023

Conversation

hwchase17
Copy link
Contributor

No description provided.

Copy link
Collaborator

@hinthornw hinthornw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be helpful - Thanks! I prefer this to the other PRs in this vein, assuming we get the validation errors to work

class RequestsWrapper(BaseModel):
"""Lightweight wrapper around requests library."""

class Requests(BaseModel):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add a docstring


async def adelete(self, url: str, **kwargs: Any) -> str:
"""DELETE the URL and return the text asynchronously."""
response = await self.requests.aget(url, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be self.requests.adelete(url, **kwargs) instead of self.requests.aget(url, **kwargs)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes good catch, thanks

@hwchase17 hwchase17 merged commit fe1eb8c into master Apr 4, 2023
9 checks passed
@hwchase17 hwchase17 deleted the harrison/requests-wrapper branch April 4, 2023 04:57
hwchase17 pushed a commit that referenced this pull request Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants