Closed siddweiker closed 5 years ago
Hey,
Are you sure you're using pysnow 0.7.4? Not explicitly passing stream=True
to get()
when using first()
should fail with:
pysnow.exceptions.InvalidUsage: first() is only available when stream=True
Ensure you're using the latest version using pysnow.__version__
, because I'm unable to reproduce this in 0.7.4 with stream=True
to Resource.get()
And yes, I realize this hasn't been updated in the docs - sorry about that. I'll have that fixed asap.
Also, I'd like to explain why this change was introduced (buffer interface by default).
I think most users are used to / expecting a buffer interface - some might read the documentation and find the stream
parameter and use it in situations where it makes sense, i.e. when working with potentially large data sets.
I'm not sure if the buffer interface is the user-expected default, it's more of my assumptions expressed in the interface design I suppose. What's your opinion?
Updated docs with clarifications in 0.7.5
Re-using a resource will cause the first call on an expired token to fail, instead of refreshing the token. Creating a new resource for every call will automatically refresh the token as expected so as a workaround, one can simply create the resource for every call.
Steps to reproduce:
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.
Code Example
Setup an oauth client per the example in the docs
Exception