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

fix: team schema parent field to object #107

Closed
wants to merge 1 commit into from

Conversation

sonac
Copy link

@sonac sonac commented Feb 5, 2021

Description of change

This change related to #94
I've taken it, since we're running into this issue in stitchdata load (which uses tap)

Manual QA steps

At the moment stitch load throws

Error persisting data to Stitch: 400: {'error': 'Record x for table teams did not conform to schema:\n#: #: no subschema matched out of the total 2 subschemas\n#: expected: null, found: JSONObject\n#/parent: #: no subschema matched out of the total 2 subschemas\n#/parent: expected: null, found: JSONObject\n#/parent: expected type: String, found: JSONObject\n'}

when a team has non-null parent
Also according to GitHub docs, it is an object: https://docs.github.com/en/rest/reference/teams#list-child-teams

Risks

Minimal, since its only changing type for one field

Rollback steps

  • revert this branch

@cmerrick
Copy link
Contributor

cmerrick commented Feb 5, 2021

Hi @sonac, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

@cmerrick
Copy link
Contributor

cmerrick commented Feb 5, 2021

You did it @sonac!

Thank you for signing the Singer Contribution License Agreement.

@ericalouie
Copy link

Hi @cmerrick! We're receiving the same error and this PR would resolve it. Is there any timeline to getting this merged?

@jcw-
Copy link

jcw- commented Nov 26, 2021

Hi @cmerrick! Chiming in as someone else looking forward to this pull request landing, as we are blocked with the same error that this PR is intended to resolve...

Error persisting data to Stitch: 400: {'error': 'Record 0 for table teams did not conform to schema:\n#: #: no subschema matched out of the total 2 subschemas\n#: expected: null, found: JSONObject\n#/parent: #: no subschema matched out of the total 2 subschemas\n#/parent: expected: null, found: JSONObject\n#/parent: expected type: String, found: JSONObject\n'}

@dmosorast
Copy link
Contributor

Hey @jcw- @ericalouie @sonac thank you for keeping up with and bumping this issue. It's really helpful to see the engagement. The team has been able to validate it and put forth in another PR #149 that will be released in the next version. Going to close this PR in lieu of that one.

@dmosorast dmosorast closed this Nov 30, 2021
@KrisPersonal
Copy link
Contributor

@jcw- @ericalouie @sonac @dmosorast This is released to Prod today

@jcw-
Copy link

jcw- commented Dec 1, 2021

@KrisPersonal @dmosorast thanks so much! this is now letting me sync those tables - however it does thousands of HTTP calls for "memberships", around 4k in my case (and many calls against team_members), and eventually hits:

API rate limit exceeded, please try after 3106 seconds.

We use nested teams - I'm wondering if that's something that might be causing some sort of unexpected behavior... issue added here: #151

2021-12-01 00:31:45,568Z    tap - CRITICAL API rate limit exceeded, please try after 3106 seconds.
2021-12-01 00:31:45,568Z    tap - Traceback (most recent call last):
2021-12-01 00:31:45,568Z    tap -   File "tap-env/bin/tap-github", line 33, in <module>
2021-12-01 00:31:45,568Z    tap -     sys.exit(load_entry_point('tap-github==1.10.1', 'console_scripts', 'tap-github')())
2021-12-01 00:31:45,568Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/singer/utils.py", line 229, in wrapped
2021-12-01 00:31:45,568Z    tap -     return fnc(*args, **kwargs)
2021-12-01 00:31:45,568Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_github/__init__.py", line 1100, in main
2021-12-01 00:31:45,568Z    tap -     do_sync(args.config, args.state, catalog)
2021-12-01 00:31:45,568Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_github/__init__.py", line 1088, in do_sync
2021-12-01 00:31:45,568Z    tap -     state = sync_func(stream_schemas, repo, state, mdata, start_date)
2021-12-01 00:31:45,569Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_github/__init__.py", line 367, in get_all_teams
2021-12-01 00:31:45,569Z    tap -     for team_memberships_rec in get_all_team_memberships(team_slug, schemas['team_memberships'], repo_path, state, mdata):
2021-12-01 00:31:45,569Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_github/__init__.py", line 404, in get_all_team_memberships
2021-12-01 00:31:45,569Z    tap -     'https://api.github.com/orgs/{}/teams/{}/memberships/{}'.format(org, team_slug, username)
2021-12-01 00:31:45,569Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_github/__init__.py", line 214, in authed_get_all_pages
2021-12-01 00:31:45,569Z    tap -     r = authed_get(source, url, headers)
2021-12-01 00:31:45,569Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_github/__init__.py", line 209, in authed_get
2021-12-01 00:31:45,569Z    tap -     rate_throttling(resp)
2021-12-01 00:31:45,569Z    tap -   File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_github/__init__.py", line 196, in rate_throttling
2021-12-01 00:31:45,569Z    tap -     raise RateLimitExceeded(message) from None
2021-12-01 00:31:45,569Z    tap - tap_github.RateLimitExceeded: API rate limit exceeded, please try after 3106 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants