-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Issue 7935/integrate httpclient to bulk job creation and status update #38685
Issue 7935/integrate httpclient to bulk job creation and status update #38685
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
return ErrorResolution(ResponseAction.IGNORE, None, None) | ||
return _NO_ERROR_RESOLUTION | ||
|
||
if response.status_code == 429 or response.status_code >= 500: |
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.
This behavior was part of the HttpStream which was used for bulk job creation requests. Hence, I moved the logic here so that it applies to all the HTTP requests performed by HttpClient
...yte-integrations/connectors/source-shopify/source_shopify/shopify_graphql/bulk/exceptions.py
Show resolved
Hide resolved
from requests.exceptions import JSONDecodeError | ||
from source_shopify.utils import ApiTypeEnum | ||
from source_shopify.utils import ShopifyRateLimiter as limiter | ||
|
||
from ...http_request import ShopifyErrorHandler |
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.
Is there a reason why we use relative import here instead of source_shopify.http_request
?
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.
Who should answer this question?
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 know but I haven't encountered any issue associated to this. It just felt odd that we do that here while we use fully qualified import elsewhere
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.
Currently, there is no such import (for master), i believe this one was added by you, with this change, if not, please attach the related PR that implemented this line, because i'm confused)
airbyte-integrations/connectors/source-shopify/source_shopify/shopify_graphql/bulk/job.py
Outdated
Show resolved
Hide resolved
@@ -21,6 +21,8 @@ | |||
exceptions.SSLError, | |||
) + RESPONSE_CONSUMPTION_EXCEPTIONS | |||
|
|||
_NO_ERROR_RESOLUTION = ErrorResolution(ResponseAction.SUCCESS, None, None) |
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.
Can we add the comment about this, what it stands for and what is the parrent used?
This change makes sense to me, but I'm concerned about the CAT tests. @maxi297, please take a look. It seems like the API Password expired or something happened in between the reading cycle. Let's ensure we still pass the correct
Once CAT passes, I'll approve this change right away, since it's pretty straightforward. Thanks @maxi297 |
@bazarnov If you want to recheck this PR, there were two weird cases on error retrying that felt weird so I changed a couple more things:
Let me know if you see issues with this. I'll move the job cancellation and fetching the job results in another PR tomorrow |
|
||
def _has_running_concurrent_job(self, errors: Optional[Iterable[Mapping[str, Any]]] = None) -> bool: | ||
""" | ||
When concurent BULK Job is already running for the same SHOP we receive: | ||
When concurrent BULK Job is already running for the same SHOP we receive: |
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.
Why would we change the concurrent
to be concurent
? I believe there is an English word concurrent
- article
This change looks good to me, left some small comments. Also, for after the latest CAT, we see this schema change for the
Should we include this as a fix to this PR as well? I believe this one will be a breaking change for the |
I'll also test the latest changes tomorrow manually to see if there are no regressions on the |
…issue-7935/integrate-httpclient-to-bulk-job-check
I would create another PR on master for that as have the two changes being independent. Does that make sense to you? |
…issue-7935/integrate-httpclient-to-bulk-job-check
aa691e7
into
issue-7935/integrate-httpclient-to-access-scopes
What
Partially address https://github.com/airbytehq/airbyte-internal-issues/issues/7935 (the bulk creation and status update part)
How
By:
Review guide
airbyte-integrations/connectors/source-shopify/source_shopify/streams/base_streams.py
While doing that, I also took the opportunity to alignstream_slices
with what cursors in the CDK do so that when we will standardize, there will be this thing less to doairbyte-integrations/connectors/source-shopify/source_shopify/shopify_graphql/bulk/job.py
User Impact
The connector should be resilient following this change as
TRANSIENT_EXCEPTIONS
will be retried (see the updated test inairbyte-integrations/connectors/source-shopify/unit_tests/integration/test_bulk_stream.py
). Apart from that, we expect no behavior change.This will also add retries on 429 + 5XX errors which will affect not only bulk job creation and status update but also access scope (see #38678)
Can this PR be safely reverted and rolled back?
TODO