-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
SimpleRetriever yield request and response as log messages #18644
Conversation
/test connector=connectors/source-courier
Build FailedTest summary info:
|
@@ -84,6 +93,27 @@ def spec(self, logger: logging.Logger) -> ConnectorSpecification: | |||
else: | |||
return super().spec(logger) | |||
|
|||
def check(self, logger: logging.Logger, config: Mapping[str, Any]) -> AirbyteConnectionStatus: | |||
self._configure_logger_level(logger) |
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.
set log level to debug if debug mode is enabled from the constructor
/test connector=connectors/source-courier
Build FailedTest summary info:
|
/test connector=connectors/source-courier
Build FailedTest summary info:
|
@@ -138,6 +138,12 @@ def stream_slices(self, sync_mode: SyncMode, stream_state: StreamState) -> Itera | |||
for parent_record in parent_stream.read_records( | |||
sync_mode=SyncMode.full_refresh, cursor_field=None, stream_slice=parent_stream_slice, stream_state=None | |||
): | |||
# Skip non-records (eg AirbyteLogMessage) | |||
if isinstance(parent_record, AirbyteMessage): |
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.
need to check the type of the output of read_records
now
/test connector=connectors/source-courier
Build PassedTest summary info:
|
@@ -35,12 +41,14 @@ class ManifestDeclarativeSource(DeclarativeSource): | |||
|
|||
VALID_TOP_LEVEL_FIELDS = {"check", "definitions", "spec", "streams", "version"} | |||
|
|||
def __init__(self, source_config: ConnectionDefinition): | |||
def __init__(self, source_config: ConnectionDefinition, debug: bool = False): |
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.
@brianjlai the connector-builder server can set this field to true
catalog: ConfiguredAirbyteCatalog, | ||
state: Union[List[AirbyteStateMessage], MutableMapping[str, Any]] = None, | ||
) -> Iterator[AirbyteMessage]: | ||
self._configure_logger_level(logger) |
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.
for the next breaking change, i feel like we should remove the logger
from these parameters. It should be bound to the instance.
catalog: ConfiguredAirbyteCatalog, | ||
state: Union[List[AirbyteStateMessage], MutableMapping[str, Any]] = None, | ||
) -> Iterator[AirbyteMessage]: | ||
self._configure_logger_level(logger) |
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.
Created a CDK v2 wishlist #19239
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.
looks good and the log messages should integrate well with the code i have for the connector builder server.
* method yielding airbytemessage * move to Stream * update abstract source * reset * missing file * Yield request and response as log messages * only emit request and responses if the debug flag is on * add test docker image * script to run acceptance tests with local cdk * Update conftest to use a different image * extract to method * dont use a different image tag * Always install local cdk * break the cdk * get path from current working directory * or * ignore unit test * debug log * Revert "AMI change: ami-0f23be2f917510c26 -> ami-005924fb76f7477ce (#18689)" This reverts commit bf06dec. * build from the top * Update source-acceptance-test * fix * copy setup * some work on the gradle plugin * reset to master * delete unused file * delete unused file * reset to master * optional argument * delete dead code * use latest cdk with sendgrid * fix sendgrid dockerfile * break the cdk * use local file * Revert "break the cdk" This reverts commit 600c195. * dont raise an exception * reset to master * unit tests * missing test * more unit tests * remove deprecated comment * newline * reset to master * remove files * reset * Update abstract source * remove method from stream * convert to airbytemessage * unittests * Update * unit test * remove debug logs * Revert "remove debug logs" This reverts commit a1a139e. * Revert "Revert "remove debug logs"" This reverts commit b1d62cd. * Revert "reset to master" This reverts commit 3fa6a00. * fix * slightly better test * typing * extract method * Revert "Revert "reset to master"" This reverts commit 5dac7c2. * reset to master * reset to master * Revert "reset to master" This reverts commit 3fa6a00. * Comment * operate on the message * Revert "Revert "reset to master"" This reverts commit 5833c84. * comment * test * Revert "test" This reverts commit 2f91b80. * test * Revert "test" This reverts commit 62d95eb. * test * Revert "test" This reverts commit 27150ba. * format * format * symlink * Update setup * update path * reset to master * update * Add local files * greenhouse * format * symlink * try reordering * better error message * better log message * reset to master * Revert "merge for qa" This reverts commit ad7128f, reversing changes made to 7196c22. * reset to master * reset to master * reset to master * format * gradlew format * right type hints * reset to master * reset to master * gradlew format * a bunch of small fixes * Update output format * fixes from feedback * fixme comment * streams cannot return AirbyteRecordMessage * fix * format * only return logs when running on debug mode * move branching * update typing * remove dead code * fix simpleretriever name * i think this is better * log response.text * debug flag * comment * pass config * comments * run SATs * fix most of the unit tests * fix unit test * reset to master * runFromPath * Revert "runFromPath" This reverts commit 85979a8. * Revert "run SATs" This reverts commit a8a8a2d. * no need to convert to dict * fix test
What
How
_read_pages
method from the HttpStream. The method reads the pages of records and is parameterized by a record generator functionSimpleRetriever
uses a custom record generator which also yields AirbyteLogMessages containing the raw request and responseManifestDeclarativeSource
which can be used to set the log level to debugRecommended reading order
airbyte-cdk/python/airbyte_cdk/sources/streams/http/http.py
airbyte-cdk/python/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py
airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request.py
airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/response.py
airbyte-cdk/python/airbyte_cdk/sources/declarative/retrievers/retriever.py
airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_stream.py
airbyte-cdk/python/airbyte_cdk/sources/utils/record_helper.py
🚨 User Impact 🚨
Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.