-
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
🎉 New Source: Iterable #2895
🎉 New Source: Iterable #2895
Conversation
…/new-connector-iterable
…/new-connector-iterable
…/new-connector-iterable
…ehq/airbyte into ykurochkin/new-connector-iterable � Conflicts: � airbyte-integrations/connectors/source-iterable/setup.py
This reverts commit e30d089
/test connector=source-iterable
|
…/new-connector-iterable
list(Lists(authenticator=authenticator)._list_records(stream_state={})) | ||
return True, None | ||
except Exception as e: | ||
return False, e |
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.
Maybe it's better to add more detail message.
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.
Done
:return: | ||
""" | ||
|
||
for templete in self.template_types: |
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 it a typo: templete
vs template
?
args = {"stream_state": stream_state} | ||
|
||
request = self._create_prepared_request( | ||
path=self.path().format(templete, message), |
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.
Typo?
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.
fixed
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 looks great! very easy to follow. Few comments and we should be ready to go. Think we can merge on Monday?
url_base = "https://api.iterable.com/api/" | ||
|
||
# Hardcode the value because it is not returned from the API | ||
BACKOFF_TIME_CONSTANT = 10.0 |
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 the expected behavior to wait 10 seconds? BTW the default behavior for backing off in the framework is an exponential backoff. So if that behavior is acceptable, we don't need this and we don't need to implement backoff_time
.
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 saw the default behavior for backing off and find that we can't use the default backoff for 429 error, because we just ignore it.
airbyte/airbyte-integrations/bases/base-python/base_python/sdk/streams/rate_limiting.py
Lines 45 to 47 in 3e68438
def should_give_up(exc): | |
# If a 4XX error makes it this far, it means it was unexpected and probably consistent, so we shouldn't back off | |
return exc.response is not None and 400 <= exc.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.
Ah I see. I have a fix for this in the latest refactor of the framework -- this is a bug. It should have and exc.response.status_code != 429
. We'll be able to refactor this soon to rely on the default backoff behavior.
parent_stream_record: Mapping = None, | ||
) -> MutableMapping[str, Any]: | ||
|
||
params = super(IterableExportStream, self).request_params(stream_state=stream_state) |
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.
are the params to super
needed?
params = super(IterableExportStream, self).request_params(stream_state=stream_state) | |
params = super().request_params(stream_state=stream_state) |
return params | ||
|
||
def path(self, **kwargs) -> str: | ||
return f"/export/data.json?dataTypeName={self.data_field}" |
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.
should dataTypeName
be specified in request_params
instead?
def get_auth_header(self) -> Mapping[str, Any]: | ||
return {} | ||
|
||
def get_auth_params(self) -> Mapping[str, Any]: |
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.
if auth is not in the headers, is it worth creating an entire Authenticator
class? Why don't we just pass the token in the constructor parameters for each stream and then the base IterableStream
class can add it in the request_params
method? authenticator
is an optional parameter for HTTP streams anyways.
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.
yeah, good idea, updated
:return: | ||
""" | ||
|
||
for template in self.template_types: |
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.
hmmm I see why you had to do this...not ideal that we are overriding an _
method. Working on an upcoming refactor that will hopefully make this much cleaner.
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 think I solved this problem and used only the read_stream
method with setting stream_params
, please look at the PR after the update.
* Iterable #2897: support incremental sync Co-authored-by: ykurochkin <y.kurochkin@zazmic.com>
/test connector=source-iterable
|
…/new-connector-iterable
/publish connector=connectors/source-iterable
|
/test connector=source-iterable
|
What
Creating new source Iterable based on Base Python
closes #2412
Pre-merge Checklist
Recommended reading order
test.java
component.ts