eric_boucher
09/16/2021, 10:50 PMtap-github
and implemented a community_profile
tap. However, some repos are returning a 404 for this query and I would like to tell the tap to just move on. I tried to tweak the post_process
function but without luck. Where would you recommend adding a check for the 404? And maybe returning an empty response instead of an error? Thanks!!
If you’re curious, here is my PR - https://github.com/oviohub/tap-github-meltano/pull/3aaronsteers
09/16/2021, 11:23 PMparse_response()
https://sdk.meltano.com/en/latest/classes/singer_sdk.RESTStream.html#singer_sdk.RESTStream.parse_responseaaronsteers
09/16/2021, 11:25 PMparse_response()
being called, then an upstream (probably internal/private) method would need to be overloaded. This seems to me very similar to the backoff/retry logic customization question where rather than having a hard failure and retry, you actually want to continue gracefully.aaronsteers
09/16/2021, 11:26 PMprepared_request = self.prepare_request(
context, next_page_token=next_page_token
)
resp = self._request_with_backoff(prepared_request, context)
for row in self.parse_response(resp):
yield row
aaronsteers
09/16/2021, 11:28 PM_request_with_backoff()
gives a hard stop, you'd need to overload that instead and/or overload the backoff logic. Both of these are possible but not thoroughly explored. Certainly something we'd be open to exploring in an issue and/or a new MR if you end up not being able to implement this by overloading public methods alone.aaronsteers
09/16/2021, 11:29 PMeric_boucher
09/16/2021, 11:37 PMeric_boucher
09/16/2021, 11:42 PMparse_response
in _request_with_backoff
aaronsteers
09/16/2021, 11:49 PM_request_with_backoff()
to solve this, but of course we'd like to find a generic+supportable solution for this. Would love it if you felt like opening an issue and/or MR with ideas on how to give devs ability to handle scenarios like this one.eric_boucher
09/16/2021, 11:51 PMaaronsteers
09/16/2021, 11:56 PM_request_with_backoff()
since in theory we could later incorporate just your changes/improvements into an MR that does the sameaaronsteers
09/17/2021, 12:00 AM_request_with_backoff()
could in theory call something like handle_response()
immediately after the response is received and the http metric is reported. Then custom implementations of handle_response()
could introduce custom logic, call the super()
or not, and finally return the response object or throw an error. I think this is where we'd also add something like raising custom rate limit exceptions (retryable or not retryable).aaronsteers
09/17/2021, 12:02 AMeric_boucher
09/17/2021, 12:32 AMtolerated_http_errors
• and created an override for _request_with_backoff
• finally I improved the GitHubStream parse_response
a bit but it could probably split into a handle and a parse to make things a bit cleaner if we wanted toeric_boucher
09/17/2021, 12:49 AMaaronsteers
09/17/2021, 12:57 AMpat_nadolny
09/17/2021, 1:31 PMeric_boucher
09/21/2021, 5:22 PMaaronsteers
09/21/2021, 5:54 PMeric_boucher
09/21/2021, 5:56 PMaaronsteers
09/21/2021, 7:53 PMeric_boucher
09/22/2021, 9:29 PMrow["type"] = 'pull_request' if row["pull_request"] else 'issue'