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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use params in _put #54

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aiocouch/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ async def _get(self) -> JsonDict:
@raises(401, "CouchDB Server Administrator privileges required")
@raises(412, "Database already exists")
async def _put(self, **params: Any) -> JsonDict:
_, json = await self._remote._put(self.endpoint)
_, json = await self._remote._put(self.endpoint, **params)
Copy link
Member

Choose a reason for hiding this comment

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

The _put method has data as the second argument and params shouldn't be expanded. I think it should simply look like this:

Suggested change
_, json = await self._remote._put(self.endpoint, **params)
_, json = await self._remote._put(self.endpoint, params=params)

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I overlooked that the kwargs are swallowed again in that method, I saw that they were passed along to _request.

What would you think about adding a kwargs parameter there and allow for the same method signature as aiohttp by passing kwargs through from the first call into aiocouch until they reach the couchdb?

Copy link
Author

Choose a reason for hiding this comment

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

Also: I saw that some tests started to fail because the parameters are no longer ignored. Maybe I need to revisit this whole pull request.

assert not isinstance(json, bytes)
return json

Expand Down
Loading