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

potential parsing error on large groups #49

Closed
elevenchars opened this issue Oct 22, 2018 · 2 comments
Closed

potential parsing error on large groups #49

elevenchars opened this issue Oct 22, 2018 · 2 comments
Labels
api behavior Issues that result from underlying API behavior

Comments

@elevenchars
Copy link

elevenchars commented Oct 22, 2018

Trying to run the example code on the documentation,

for group in client.groups.list_all():
        print(group.name)

throws a groupy.exceptions.InvalidJsonError. However, when I run this instead:

for group in client.groups.list(omit="membership").autopage():
  print(group.name)

it runs successfully. This leads me to think that large user counts cause the JSON parsing to fail. I am in quite a few large groups (1800+, 700+, multiple 100+) which I think may be causing the issue.

@elevenchars
Copy link
Author

Python version: 3.7.0
Groupy version: 0.10.2
OS: MacOS 10.14

@rhgrant10
Copy link
Owner

Yeah this is a known issue with the API :-(

There's a maximum response size so groups with tons of members can trigger this problem. It's not necessarily predictable either since groups are sorted by last updated time. Two large groups might update and be in the same page of results, but they might not and instead be on different pages.

You can also omit memberships when using list_all by the way. As always just be sure to call refresh_from_server on the group before working with its memberships.

@rhgrant10 rhgrant10 added api behavior Issues that result from underlying API behavior and removed help wanted labels Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api behavior Issues that result from underlying API behavior
Projects
None yet
Development

No branches or pull requests

2 participants