-
Notifications
You must be signed in to change notification settings - Fork 14
[BUG] Fix results_iter when API returns an object CAT-213 #35
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
[BUG] Fix results_iter when API returns an object CAT-213 #35
Conversation
…ns an object CAT-213
|
|
||
| def _build_base_url(self): | ||
| @staticmethod | ||
| def __build_base_url(): |
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.
I changed this to a static method as it's only used internally by the integration tests and does not access any class variables.
…I returns an object CAT-213
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'll continue without the CI approvals because it's a config issue in Travis. #36 should cleanup this error, but fine for now.
learnosity_sdk/request/dataapi.py
Outdated
| for result in response['data']: | ||
| yield result | ||
| if isinstance(response['data'], dict): | ||
| for key, value in Future.iteritems(response['data']): |
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.
No need for Future:
| for key, value in Future.iteritems(response['data']): | |
| for key in response['data']: | |
| yield {key: response['data'][key]} |
shtrom
left a comment
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.
I don't think we need to add this Future helper.
…when API returns an object CAT-213
Co-Authored-By: Olivier Mehani <[email protected]>
shtrom
left a comment
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.
Looks good. Haven't funced.
|
We'll have to remember to remove the |
Fixes #34
Checklist
Feature
Bug
Security
Documentation
ChangeLog.md updated
Tests added
All testsuites passed
make distcompleted successfully