Skip to content

Commit

Permalink
docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
girarda committed Aug 11, 2022
1 parent 650ef56 commit 7024ecc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,27 @@
@dataclass
class DpathExtractor(RecordExtractor, JsonSchemaMixin):
"""
Record extractor that evaluates a Jello query to extract records from a decoded response.
More information on Jello can be found at https://github.com/kellyjonbrazil/jello
Record extractor that searches a decoded response over a path defined as an array of fields.
Examples of instantiating this transform:
```
extractor:
type: DpathExtractor
transform:
- "root"
- "data"
```
```
extractor:
type: DpathExtractor
transform:
- "root"
- "{{ options['field'] }}"
```
Attributes:
transform (Union[InterpolatedString, str]): The Jello query to evaluate on the decoded response
transform (Union[InterpolatedString, str]): Pointer to the field that should be extracted
config (Config): The user-provided configuration as specified by the source's spec
decoder (Decoder): The decoder responsible to transfom the response in a Mapping
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from airbyte_cdk.sources.declarative.auth.token import ApiKeyAuthenticator, BasicHttpAuthenticator, BearerAuthenticator
from airbyte_cdk.sources.declarative.datetime.min_max_datetime import MinMaxDatetime
from airbyte_cdk.sources.declarative.declarative_stream import DeclarativeStream
from airbyte_cdk.sources.declarative.extractors.dpath_extractor import DpathExtractor
from airbyte_cdk.sources.declarative.extractors.jello import JelloExtractor
from airbyte_cdk.sources.declarative.extractors.record_selector import RecordSelector
from airbyte_cdk.sources.declarative.interpolation.interpolated_boolean import InterpolatedBoolean
Expand Down Expand Up @@ -46,6 +47,7 @@
"DatetimeStreamSlicer": DatetimeStreamSlicer,
"DeclarativeStream": DeclarativeStream,
"DefaultErrorHandler": DefaultErrorHandler,
"DpathExtractor": DpathExtractor,
"ExponentialBackoffStrategy": ExponentialBackoffStrategy,
"HttpRequester": HttpRequester,
"InterpolatedBoolean": InterpolatedBoolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
InterpolatedString: InterpolatedString,
MinMaxDatetime: MinMaxDatetime,
Paginator: NoPagination,
ParentStreamConfig: ParentStreamConfig,
RecordExtractor: JelloExtractor,
RequestOption: RequestOption,
RequestOptionsProvider: InterpolatedRequestOptionsProvider,
Requester: HttpRequester,
Retriever: SimpleRetriever,
ParentStreamConfig: ParentStreamConfig,
SchemaLoader: JsonSchema,
Stream: DeclarativeStream,
StreamSlicer: SingleSlice,
RecordExtractor: JelloExtractor,
}

0 comments on commit 7024ecc

Please sign in to comment.