-
Notifications
You must be signed in to change notification settings - Fork 116
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
Users and Spaces V3 implementation #136
base: master
Are you sure you want to change the base?
Conversation
@@ -99,7 +100,8 @@ def request_headers(self): | |||
headers["Content-Encoding"] = "gzip" | |||
if self.http_method() == HttpMethod.POST: | |||
headers["Content-type"] = "application/json" | |||
|
|||
if self._custom_headers: |
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.
https://peps.python.org/pep-0008/#programming-recommendations
Initially self._custom_headers
is equal None
. In this case you should check if your variable is None or not. I assume that custom_headers
variable is a dict. So you can change initial value from None to empty dict ;)
else: | ||
raise ValueError() | ||
|
||
if len(inclusions) > 0: |
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.
if inclusions
|
||
params["sort"] = ",".join(joined_sort_params_array) | ||
|
||
if self._page: |
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.
_page
could be None? If yes you should check it here ;)
from pubnub.models.consumer.entities.space import PNCreateSpaceResult, PNFetchSpaceResult, PNFetchSpacesResult, \ | ||
PNUpdateSpaceResult, PNUpsertSpaceResult | ||
|
||
from pubnub.pubnub import PubNub |
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.
Decide which import way you want to use in this file and then stick to it ;)
No description provided.