-
Notifications
You must be signed in to change notification settings - Fork 6
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(airbyte-cdk): unable to create custom retriever #198
base: main
Are you sure you want to change the base?
Changes from 4 commits
064eb6d
100ce81
513a533
c18f0d7
300fc07
8c139f0
744132b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1560,7 +1560,12 @@ def create_exponential_backoff_strategy( | |
) | ||
|
||
def create_http_requester( | ||
self, model: HttpRequesterModel, decoder: Decoder, config: Config, *, name: str | ||
self, | ||
model: HttpRequesterModel, | ||
config: Config, | ||
decoder: Decoder = JsonDecoder(parameters={}), | ||
*, | ||
name: str, | ||
) -> HttpRequester: | ||
authenticator = ( | ||
self._create_component_from_model( | ||
|
@@ -1976,7 +1981,7 @@ def create_record_selector( | |
config: Config, | ||
*, | ||
name: str, | ||
transformations: List[RecordTransformation], | ||
transformations: Optional[List[RecordTransformation]] = None, | ||
aldogonzalez8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
decoder: Optional[Decoder] = None, | ||
client_side_incremental_sync: Optional[Dict[str, Any]] = None, | ||
**kwargs: Any, | ||
|
@@ -2008,7 +2013,7 @@ def create_record_selector( | |
name=name, | ||
config=config, | ||
record_filter=record_filter, | ||
transformations=transformations, | ||
transformations=transformations or [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking: Is it intentional that transformations default to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lint was very annoyed about using a mutable object as the default, and I thought it was safer to pass [] as the default factory does here for RecordSelector. |
||
schema_normalization=schema_normalization, | ||
parameters=model.parameters or {}, | ||
) | ||
|
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.
Help me with my shitty Python knowledge. The signature change does two things here:
decoder
— this is additive and will fix situations where decoder was not passed inThere 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 is important but we assume
model_to_component_factory
is quite mostly private to the CDK hence I'm fine with this breaking changeThere 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.
Yes
Usually (and from what I could find in CDK and airbyte base code), this method is only called by
_create_component_from_model
, which passes the parameters as keyword args.