airbyte-cdk 0.31.0__tar.gz → 0.32.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (270) hide show
  1. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/PKG-INFO +1 -1
  2. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/connector_builder/message_grouper.py +64 -23
  3. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/connector_builder/models.py +7 -1
  4. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/abstract_source.py +3 -7
  5. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk.egg-info/PKG-INFO +1 -1
  6. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/setup.py +1 -1
  7. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/connector_builder/test_connector_builder_handler.py +22 -4
  8. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/connector_builder/test_message_grouper.py +20 -5
  9. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/test_abstract_source.py +6 -8
  10. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/LICENSE.txt +0 -0
  11. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/README.md +0 -0
  12. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/__init__.py +0 -0
  13. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/config_observation.py +0 -0
  14. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/connector.py +0 -0
  15. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/connector_builder/__init__.py +0 -0
  16. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/connector_builder/connector_builder_handler.py +0 -0
  17. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/connector_builder/main.py +0 -0
  18. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/destinations/__init__.py +0 -0
  19. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/destinations/destination.py +0 -0
  20. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/entrypoint.py +0 -0
  21. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/exception_handler.py +0 -0
  22. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/logger.py +0 -0
  23. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/models/__init__.py +0 -0
  24. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/models/airbyte_protocol.py +0 -0
  25. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/models/well_known_types.py +0 -0
  26. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/py.typed +0 -0
  27. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/__init__.py +0 -0
  28. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/config.py +0 -0
  29. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/connector_state_manager.py +0 -0
  30. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/__init__.py +0 -0
  31. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/auth/__init__.py +0 -0
  32. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/auth/declarative_authenticator.py +0 -0
  33. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/auth/oauth.py +0 -0
  34. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/auth/token.py +0 -0
  35. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/checks/__init__.py +0 -0
  36. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/checks/check_stream.py +0 -0
  37. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/checks/connection_checker.py +0 -0
  38. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/create_partial.py +0 -0
  39. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/datetime/__init__.py +0 -0
  40. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/datetime/datetime_parser.py +0 -0
  41. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/datetime/min_max_datetime.py +0 -0
  42. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/declarative_component_schema.yaml +0 -0
  43. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/declarative_source.py +0 -0
  44. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/declarative_stream.py +0 -0
  45. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/decoders/__init__.py +0 -0
  46. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/decoders/decoder.py +0 -0
  47. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/decoders/json_decoder.py +0 -0
  48. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/exceptions.py +0 -0
  49. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/extractors/__init__.py +0 -0
  50. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/extractors/dpath_extractor.py +0 -0
  51. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/extractors/http_selector.py +0 -0
  52. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/extractors/record_extractor.py +0 -0
  53. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/extractors/record_filter.py +0 -0
  54. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/extractors/record_selector.py +0 -0
  55. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/incremental/__init__.py +0 -0
  56. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/incremental/datetime_based_cursor.py +0 -0
  57. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/interpolation/__init__.py +0 -0
  58. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/interpolation/filters.py +0 -0
  59. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py +0 -0
  60. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/interpolation/interpolated_mapping.py +0 -0
  61. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/interpolation/interpolated_string.py +0 -0
  62. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/interpolation/interpolation.py +0 -0
  63. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/interpolation/jinja.py +0 -0
  64. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/interpolation/macros.py +0 -0
  65. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/manifest_declarative_source.py +0 -0
  66. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/models/__init__.py +0 -0
  67. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/models/declarative_component_schema.py +0 -0
  68. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/parsers/__init__.py +0 -0
  69. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/parsers/class_types_registry.py +0 -0
  70. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/parsers/custom_exceptions.py +0 -0
  71. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/parsers/default_implementation_registry.py +0 -0
  72. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py +0 -0
  73. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py +0 -0
  74. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py +0 -0
  75. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/partition_routers/__init__.py +0 -0
  76. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/partition_routers/list_partition_router.py +0 -0
  77. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/partition_routers/single_partition_router.py +0 -0
  78. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/partition_routers/substream_partition_router.py +0 -0
  79. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/__init__.py +0 -0
  80. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/__init__.py +0 -0
  81. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/__init__.py +0 -0
  82. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/constant_backoff_strategy.py +0 -0
  83. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/exponential_backoff_strategy.py +0 -0
  84. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/header_helper.py +0 -0
  85. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/wait_time_from_header_backoff_strategy.py +0 -0
  86. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/wait_until_time_from_header_backoff_strategy.py +0 -0
  87. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategy.py +0 -0
  88. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/composite_error_handler.py +0 -0
  89. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/default_error_handler.py +0 -0
  90. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/error_handler.py +0 -0
  91. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/http_response_filter.py +0 -0
  92. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/response_action.py +0 -0
  93. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/error_handlers/response_status.py +0 -0
  94. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/http_requester.py +0 -0
  95. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/__init__.py +0 -0
  96. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/default_paginator.py +0 -0
  97. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/no_pagination.py +0 -0
  98. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/paginator.py +0 -0
  99. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/strategies/__init__.py +0 -0
  100. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/strategies/cursor_pagination_strategy.py +0 -0
  101. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/strategies/offset_increment.py +0 -0
  102. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/strategies/page_increment.py +0 -0
  103. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/paginators/strategies/pagination_strategy.py +0 -0
  104. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/request_option.py +0 -0
  105. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/request_options/__init__.py +0 -0
  106. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py +0 -0
  107. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py +0 -0
  108. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/request_options/request_options_provider.py +0 -0
  109. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/request_path.py +0 -0
  110. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/requesters/requester.py +0 -0
  111. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/retrievers/__init__.py +0 -0
  112. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/retrievers/retriever.py +0 -0
  113. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py +0 -0
  114. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/schema/__init__.py +0 -0
  115. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/schema/default_schema_loader.py +0 -0
  116. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/schema/inline_schema_loader.py +0 -0
  117. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/schema/json_file_schema_loader.py +0 -0
  118. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/schema/schema_loader.py +0 -0
  119. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/spec/__init__.py +0 -0
  120. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/spec/spec.py +0 -0
  121. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/stream_slicers/__init__.py +0 -0
  122. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/stream_slicers/cartesian_product_stream_slicer.py +0 -0
  123. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/stream_slicers/stream_slicer.py +0 -0
  124. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/transformations/__init__.py +0 -0
  125. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/transformations/add_fields.py +0 -0
  126. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/transformations/remove_fields.py +0 -0
  127. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/transformations/transformation.py +0 -0
  128. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/types.py +0 -0
  129. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/declarative/yaml_declarative_source.py +0 -0
  130. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/deprecated/__init__.py +0 -0
  131. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/deprecated/base_source.py +0 -0
  132. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/deprecated/client.py +0 -0
  133. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/singer/__init__.py +0 -0
  134. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/singer/singer_helpers.py +0 -0
  135. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/singer/source.py +0 -0
  136. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/source.py +0 -0
  137. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/__init__.py +0 -0
  138. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/availability_strategy.py +0 -0
  139. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/core.py +0 -0
  140. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/__init__.py +0 -0
  141. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/auth/__init__.py +0 -0
  142. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/auth/core.py +0 -0
  143. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/auth/oauth.py +0 -0
  144. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/auth/token.py +0 -0
  145. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/availability_strategy.py +0 -0
  146. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/exceptions.py +0 -0
  147. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/http.py +0 -0
  148. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/rate_limiting.py +0 -0
  149. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/requests_native_auth/__init__.py +0 -0
  150. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py +0 -0
  151. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_token.py +0 -0
  152. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py +0 -0
  153. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/http/requests_native_auth/token.py +0 -0
  154. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/utils/__init__.py +0 -0
  155. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/streams/utils/stream_helper.py +0 -0
  156. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/utils/__init__.py +0 -0
  157. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/utils/casing.py +0 -0
  158. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/utils/catalog_helpers.py +0 -0
  159. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/utils/record_helper.py +0 -0
  160. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/utils/schema_helpers.py +0 -0
  161. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/utils/schema_models.py +0 -0
  162. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/sources/utils/transform.py +0 -0
  163. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/utils/__init__.py +0 -0
  164. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/utils/airbyte_secrets_utils.py +0 -0
  165. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/utils/event_timing.py +0 -0
  166. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/utils/schema_inferrer.py +0 -0
  167. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk/utils/traced_exception.py +0 -0
  168. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk.egg-info/SOURCES.txt +0 -0
  169. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk.egg-info/dependency_links.txt +0 -0
  170. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk.egg-info/requires.txt +0 -0
  171. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/airbyte_cdk.egg-info/top_level.txt +0 -0
  172. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/pyproject.toml +0 -0
  173. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/setup.cfg +0 -0
  174. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/source_declarative_manifest/__init__.py +0 -0
  175. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/source_declarative_manifest/main.py +0 -0
  176. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/connector_builder/__init__.py +0 -0
  177. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/connector_builder/utils.py +0 -0
  178. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/destinations/__init__.py +0 -0
  179. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/destinations/test_destination.py +0 -0
  180. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/singer/__init__.py +0 -0
  181. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/singer/test_singer_helpers.py +0 -0
  182. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/singer/test_singer_source.py +0 -0
  183. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/__init__.py +0 -0
  184. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/__init__.py +0 -0
  185. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/auth/__init__.py +0 -0
  186. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/auth/test_oauth.py +0 -0
  187. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/auth/test_session_token_auth.py +0 -0
  188. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/auth/test_token_auth.py +0 -0
  189. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/checks/__init__.py +0 -0
  190. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/checks/test_check_stream.py +0 -0
  191. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/decoders/__init__.py +0 -0
  192. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/decoders/test_json_decoder.py +0 -0
  193. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/external_component.py +0 -0
  194. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/extractors/__init__.py +0 -0
  195. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/extractors/test_dpath_extractor.py +0 -0
  196. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/extractors/test_record_filter.py +0 -0
  197. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/extractors/test_record_selector.py +0 -0
  198. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/incremental/__init__.py +0 -0
  199. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/incremental/test_datetime_based_cursor.py +0 -0
  200. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/interpolation/__init__.py +0 -0
  201. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/interpolation/test_filters.py +0 -0
  202. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/interpolation/test_interpolated_boolean.py +0 -0
  203. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/interpolation/test_interpolated_mapping.py +0 -0
  204. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/interpolation/test_interpolated_string.py +0 -0
  205. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/interpolation/test_jinja.py +0 -0
  206. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/interpolation/test_macros.py +0 -0
  207. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/parsers/__init__.py +0 -0
  208. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/parsers/test_manifest_component_transformer.py +0 -0
  209. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/parsers/test_manifest_reference_resolver.py +0 -0
  210. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/parsers/test_model_to_component_factory.py +0 -0
  211. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/parsers/testing_components.py +0 -0
  212. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/partition_routers/__init__.py +0 -0
  213. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/partition_routers/test_list_partition_router.py +0 -0
  214. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/partition_routers/test_single_partition_router.py +0 -0
  215. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/partition_routers/test_substream_partition_router.py +0 -0
  216. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/__init__.py +0 -0
  217. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/__init__.py +0 -0
  218. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/backoff_strategies/__init__.py +0 -0
  219. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/backoff_strategies/test_constant_backoff.py +0 -0
  220. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/backoff_strategies/test_exponential_backoff.py +0 -0
  221. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/backoff_strategies/test_header_helper.py +0 -0
  222. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/backoff_strategies/test_wait_time_from_header.py +0 -0
  223. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/backoff_strategies/test_wait_until_time_from_header.py +0 -0
  224. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/test_composite_error_handler.py +0 -0
  225. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/test_default_error_handler.py +0 -0
  226. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/test_http_response_filter.py +0 -0
  227. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/error_handlers/test_response_status.py +0 -0
  228. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/paginators/__init__.py +0 -0
  229. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/paginators/test_cursor_pagination_strategy.py +0 -0
  230. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/paginators/test_default_paginator.py +0 -0
  231. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/paginators/test_no_paginator.py +0 -0
  232. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/paginators/test_offset_increment.py +0 -0
  233. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/paginators/test_page_increment.py +0 -0
  234. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/paginators/test_request_option.py +0 -0
  235. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/request_options/__init__.py +0 -0
  236. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py +0 -0
  237. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/test_http_requester.py +0 -0
  238. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/requesters/test_interpolated_request_input_provider.py +0 -0
  239. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/retrievers/__init__.py +0 -0
  240. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/retrievers/test_simple_retriever.py +0 -0
  241. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/schema/__init__.py +0 -0
  242. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/schema/source_test/SourceTest.py +0 -0
  243. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/schema/source_test/__init__.py +0 -0
  244. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/schema/test_default_schema_loader.py +0 -0
  245. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/schema/test_inline_schema_loader.py +0 -0
  246. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/schema/test_json_file_schema_loader.py +0 -0
  247. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/states/__init__.py +0 -0
  248. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/stream_slicers/__init__.py +0 -0
  249. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/stream_slicers/test_cartesian_product_stream_slicer.py +0 -0
  250. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/test_create_partial.py +0 -0
  251. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/test_declarative_stream.py +0 -0
  252. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/test_manifest_declarative_source.py +0 -0
  253. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/declarative/test_yaml_declarative_source.py +0 -0
  254. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/__init__.py +0 -0
  255. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/http/__init__.py +0 -0
  256. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/http/auth/__init__.py +0 -0
  257. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/http/auth/test_auth.py +0 -0
  258. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/http/requests_native_auth/__init__.py +0 -0
  259. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/http/requests_native_auth/test_requests_native_auth.py +0 -0
  260. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/http/test_availability_strategy.py +0 -0
  261. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/http/test_http.py +0 -0
  262. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/test_availability_strategy.py +0 -0
  263. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/streams/test_streams_core.py +0 -0
  264. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/test_config.py +0 -0
  265. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/test_connector_state_manager.py +0 -0
  266. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/sources/test_source.py +0 -0
  267. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/utils/__init__.py +0 -0
  268. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/utils/test_schema_inferrer.py +0 -0
  269. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/utils/test_secret_utils.py +0 -0
  270. {airbyte-cdk-0.31.0 → airbyte-cdk-0.32.0}/unit_tests/utils/test_traced_exception.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 0.31.0
3
+ Version: 0.32.0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://github.com/airbytehq/airbyte
6
6
  Author: Airbyte
@@ -6,14 +6,30 @@ import json
6
6
  import logging
7
7
  from copy import deepcopy
8
8
  from json import JSONDecodeError
9
- from typing import Any, Iterable, Iterator, Mapping, Optional, Union
9
+ from typing import Any, Iterable, Iterator, List, Mapping, Optional, Union
10
10
  from urllib.parse import parse_qs, urlparse
11
11
 
12
- from airbyte_cdk.connector_builder.models import HttpRequest, HttpResponse, StreamRead, StreamReadPages, StreamReadSlices
13
- from airbyte_cdk.models import AirbyteLogMessage, AirbyteMessage, Type
12
+ from airbyte_cdk.connector_builder.models import (
13
+ HttpRequest,
14
+ HttpResponse,
15
+ LogMessage,
16
+ StreamRead,
17
+ StreamReadPages,
18
+ StreamReadSlices,
19
+ StreamReadSlicesInner,
20
+ )
14
21
  from airbyte_cdk.sources.declarative.declarative_source import DeclarativeSource
22
+ from airbyte_cdk.utils import AirbyteTracedException
15
23
  from airbyte_cdk.utils.schema_inferrer import SchemaInferrer
16
- from airbyte_protocol.models.airbyte_protocol import ConfiguredAirbyteCatalog
24
+ from airbyte_protocol.models.airbyte_protocol import (
25
+ AirbyteLogMessage,
26
+ AirbyteMessage,
27
+ AirbyteTraceMessage,
28
+ ConfiguredAirbyteCatalog,
29
+ Level,
30
+ TraceType,
31
+ )
32
+ from airbyte_protocol.models.airbyte_protocol import Type as MessageType
17
33
 
18
34
 
19
35
  class MessageGrouper:
@@ -42,14 +58,18 @@ class MessageGrouper:
42
58
 
43
59
  slices = []
44
60
  log_messages = []
45
- state = {} # No support for incremental sync
46
61
  for message_group in self._get_message_groups(
47
- source.read(self.logger, config, configured_catalog, state),
48
- schema_inferrer,
49
- record_limit,
62
+ self._read_stream(source, config, configured_catalog),
63
+ schema_inferrer,
64
+ record_limit,
50
65
  ):
51
66
  if isinstance(message_group, AirbyteLogMessage):
52
- log_messages.append({"message": message_group.message})
67
+ log_messages.append(LogMessage(**{"message": message_group.message, "level": message_group.level.value}))
68
+ elif isinstance(message_group, AirbyteTraceMessage):
69
+ if message_group.type == TraceType.ERROR:
70
+ error_message = f"{message_group.error.message} - {message_group.error.stack_trace}"
71
+ log_messages.append(LogMessage(**{"message": error_message, "level": "ERROR"}))
72
+
53
73
  else:
54
74
  slices.append(message_group)
55
75
 
@@ -63,8 +83,8 @@ class MessageGrouper:
63
83
  )
64
84
 
65
85
  def _get_message_groups(
66
- self, messages: Iterator[AirbyteMessage], schema_inferrer: SchemaInferrer, limit: int
67
- ) -> Iterable[Union[StreamReadPages, AirbyteLogMessage]]:
86
+ self, messages: Iterator[AirbyteMessage], schema_inferrer: SchemaInferrer, limit: int
87
+ ) -> Iterable[Union[StreamReadPages, AirbyteLogMessage, AirbyteTraceMessage]]:
68
88
  """
69
89
  Message groups are partitioned according to when request log messages are received. Subsequent response log messages
70
90
  and record messages belong to the prior request log message and when we encounter another request, append the latest
@@ -86,44 +106,56 @@ class MessageGrouper:
86
106
  current_slice_pages = []
87
107
  current_page_request: Optional[HttpRequest] = None
88
108
  current_page_response: Optional[HttpResponse] = None
109
+ had_error = False
89
110
 
90
111
  while records_count < limit and (message := next(messages, None)):
91
112
  if self._need_to_close_page(at_least_one_page_in_group, message):
92
- self._close_page(current_page_request, current_page_response, current_slice_pages, current_page_records)
113
+ self._close_page(current_page_request, current_page_response, current_slice_pages, current_page_records, True)
93
114
  current_page_request = None
94
115
  current_page_response = None
95
116
 
96
- if at_least_one_page_in_group and message.type == Type.LOG and message.log.message.startswith("slice:"):
117
+ if at_least_one_page_in_group and message.type == MessageType.LOG and message.log.message.startswith("slice:"):
97
118
  yield StreamReadSlices(pages=current_slice_pages)
98
119
  current_slice_pages = []
99
120
  at_least_one_page_in_group = False
100
- elif message.type == Type.LOG and message.log.message.startswith("request:"):
121
+ elif message.type == MessageType.LOG and message.log.message.startswith("request:"):
101
122
  if not at_least_one_page_in_group:
102
123
  at_least_one_page_in_group = True
103
124
  current_page_request = self._create_request_from_log_message(message.log)
104
- elif message.type == Type.LOG and message.log.message.startswith("response:"):
125
+ elif message.type == MessageType.LOG and message.log.message.startswith("response:"):
105
126
  current_page_response = self._create_response_from_log_message(message.log)
106
- elif message.type == Type.LOG:
127
+ elif message.type == MessageType.LOG:
128
+ if message.log.level == Level.ERROR:
129
+ had_error = True
107
130
  yield message.log
108
- elif message.type == Type.RECORD:
131
+ elif message.type == MessageType.TRACE:
132
+ if message.trace.type == TraceType.ERROR:
133
+ had_error = True
134
+ yield message.trace
135
+ elif message.type == MessageType.RECORD:
109
136
  current_page_records.append(message.record.data)
110
137
  records_count += 1
111
138
  schema_inferrer.accumulate(message.record)
112
139
  else:
113
- self._close_page(current_page_request, current_page_response, current_slice_pages, current_page_records)
140
+ self._close_page(current_page_request, current_page_response, current_slice_pages, current_page_records, validate_page_complete=not had_error)
114
141
  yield StreamReadSlices(pages=current_slice_pages)
115
142
 
116
143
  @staticmethod
117
- def _need_to_close_page(at_least_one_page_in_group, message):
144
+ def _need_to_close_page(at_least_one_page_in_group: bool, message: AirbyteMessage) -> bool:
118
145
  return (
119
146
  at_least_one_page_in_group
120
- and message.type == Type.LOG
147
+ and message.type == MessageType.LOG
121
148
  and (message.log.message.startswith("request:") or message.log.message.startswith("slice:"))
122
149
  )
123
150
 
124
151
  @staticmethod
125
- def _close_page(current_page_request, current_page_response, current_slice_pages, current_page_records):
126
- if not current_page_request or not current_page_response:
152
+ def _close_page(current_page_request, current_page_response, current_slice_pages, current_page_records, validate_page_complete: bool):
153
+ """
154
+ Close a page when parsing message groups
155
+ @param validate_page_complete: in some cases, we expect the CDK to not return a response. As of today, this will only happen before
156
+ an uncaught exception and therefore, the assumption is that `validate_page_complete=True` only on the last page that is being closed
157
+ """
158
+ if validate_page_complete and (not current_page_request or not current_page_response):
127
159
  raise ValueError("Every message grouping should have at least one request and response")
128
160
 
129
161
  current_slice_pages.append(
@@ -131,6 +163,15 @@ class MessageGrouper:
131
163
  )
132
164
  current_page_records.clear()
133
165
 
166
+ def _read_stream(self, source: DeclarativeSource, config: Mapping[str, Any], configured_catalog: ConfiguredAirbyteCatalog) -> Iterator[AirbyteMessage]:
167
+ # the generator can raise an exception
168
+ # iterate over the generated messages. if next raise an exception, catch it and yield it as an AirbyteLogMessage
169
+ try:
170
+ yield from source.read(logger=self.logger, config=config, catalog=configured_catalog, state={})
171
+ except Exception as e:
172
+ error_message = f"{e.args[0] if len(e.args) > 0 else str(e)}"
173
+ yield AirbyteTracedException.from_exception(e, message=error_message).as_airbyte_message()
174
+
134
175
  def _create_request_from_log_message(self, log_message: AirbyteLogMessage) -> Optional[HttpRequest]:
135
176
  # TODO: As a temporary stopgap, the CDK emits request data as a log message string. Ideally this should come in the
136
177
  # form of a custom message object defined in the Airbyte protocol, but this unblocks us in the immediate while the
@@ -165,7 +206,7 @@ class MessageGrouper:
165
206
  self.logger.warning(f"Failed to parse log message into response object with error: {error}")
166
207
  return None
167
208
 
168
- def _has_reached_limit(self, slices):
209
+ def _has_reached_limit(self, slices: List[StreamReadSlicesInner]):
169
210
  if len(slices) >= self._max_slices:
170
211
  return True
171
212
 
@@ -50,9 +50,15 @@ class StreamReadSlicesInner:
50
50
  state: Optional[Dict[str, Any]]
51
51
 
52
52
 
53
+ @dataclass
54
+ class LogMessage:
55
+ message: str
56
+ level: str
57
+
58
+
53
59
  @dataclass
54
60
  class StreamRead(object):
55
- logs: List[object]
61
+ logs: List[LogMessage]
56
62
  slices: List[StreamReadSlicesInner]
57
63
  test_read_limit_reached: bool
58
64
  inferred_schema: Optional[Dict[str, Any]]
@@ -79,13 +79,9 @@ class AbstractSource(Source, ABC):
79
79
  """Implements the Check Connection operation from the Airbyte Specification.
80
80
  See https://docs.airbyte.com/understanding-airbyte/airbyte-protocol/#check.
81
81
  """
82
- try:
83
- check_succeeded, error = self.check_connection(logger, config)
84
- if not check_succeeded:
85
- return AirbyteConnectionStatus(status=Status.FAILED, message=repr(error))
86
- except Exception as e:
87
- return AirbyteConnectionStatus(status=Status.FAILED, message=repr(e))
88
-
82
+ check_succeeded, error = self.check_connection(logger, config)
83
+ if not check_succeeded:
84
+ return AirbyteConnectionStatus(status=Status.FAILED, message=repr(error))
89
85
  return AirbyteConnectionStatus(status=Status.SUCCEEDED)
90
86
 
91
87
  def read(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 0.31.0
3
+ Version: 0.32.0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://github.com/airbytehq/airbyte
6
6
  Author: Airbyte
@@ -17,7 +17,7 @@ setup(
17
17
  name="airbyte-cdk",
18
18
  # The version of the airbyte-cdk package is used at runtime to validate manifests. That validation must be
19
19
  # updated if our semver format changes such as using release candidate versions.
20
- version="0.31.0",
20
+ version="0.32.0",
21
21
  description="A framework for writing Airbyte Connectors.",
22
22
  long_description=README,
23
23
  long_description_content_type="text/markdown",
@@ -3,6 +3,7 @@
3
3
  #
4
4
 
5
5
  import copy
6
+ import dataclasses
6
7
  import json
7
8
  from unittest import mock
8
9
  from unittest.mock import patch
@@ -11,7 +12,7 @@ import pytest
11
12
  from airbyte_cdk import connector_builder
12
13
  from airbyte_cdk.connector_builder.connector_builder_handler import list_streams, resolve_manifest
13
14
  from airbyte_cdk.connector_builder.main import handle_connector_builder_request, handle_request, read_stream
14
- from airbyte_cdk.connector_builder.models import StreamRead, StreamReadSlicesInner, StreamReadSlicesInnerPagesInner
15
+ from airbyte_cdk.connector_builder.models import LogMessage, StreamRead, StreamReadSlicesInner, StreamReadSlicesInnerPagesInner
15
16
  from airbyte_cdk.models import AirbyteMessage, AirbyteRecordMessage, ConfiguredAirbyteCatalog
16
17
  from airbyte_cdk.models import Type as MessageType
17
18
  from airbyte_cdk.sources.declarative.declarative_stream import DeclarativeStream
@@ -323,14 +324,31 @@ def test_read():
323
324
  assert output_record == expected_airbyte_message
324
325
 
325
326
 
326
- def test_read_returns_error_response():
327
+ @patch("traceback.TracebackException.from_exception")
328
+ def test_read_returns_error_response(mock_from_exception):
327
329
  class MockManifestDeclarativeSource:
328
330
  def read(self, logger, config, catalog, state):
329
- raise ValueError
331
+ raise ValueError("error_message")
332
+
333
+ stack_trace = "a stack trace"
334
+ mock_from_exception.return_value = stack_trace
330
335
 
331
336
  source = MockManifestDeclarativeSource()
332
337
  response = read_stream(source, TEST_READ_CONFIG, ConfiguredAirbyteCatalog.parse_obj(CONFIGURED_CATALOG))
333
- assert "Error reading" in response.trace.error.message
338
+
339
+ expected_stream_read = StreamRead(logs=[LogMessage("error_message - a stack trace", "ERROR")],
340
+ slices=[StreamReadSlicesInner(
341
+ pages=[StreamReadSlicesInnerPagesInner(records=[], request=None, response=None)],
342
+ slice_descriptor=None, state=None)],
343
+ test_read_limit_reached=False,
344
+ inferred_schema=None)
345
+
346
+ expected_message = AirbyteMessage(
347
+ type=MessageType.RECORD,
348
+ record=AirbyteRecordMessage(stream=_stream_name, data=dataclasses.asdict(expected_stream_read), emitted_at=1),
349
+ )
350
+ response.record.emitted_at = 1
351
+ assert response == expected_message
334
352
 
335
353
 
336
354
  @pytest.mark.parametrize(
@@ -8,7 +8,7 @@ from unittest.mock import MagicMock
8
8
 
9
9
  import pytest
10
10
  from airbyte_cdk.connector_builder.message_grouper import MessageGrouper
11
- from airbyte_cdk.connector_builder.models import HttpRequest, HttpResponse, StreamRead, StreamReadPages
11
+ from airbyte_cdk.connector_builder.models import HttpRequest, HttpResponse, LogMessage, StreamRead, StreamReadPages
12
12
  from airbyte_cdk.models import AirbyteLogMessage, AirbyteMessage, AirbyteRecordMessage, Level
13
13
  from airbyte_cdk.models import Type as MessageType
14
14
  from unit_tests.connector_builder.utils import create_configured_catalog
@@ -17,7 +17,7 @@ MAX_PAGES_PER_SLICE = 4
17
17
  MAX_SLICES = 3
18
18
 
19
19
  MANIFEST = {
20
- "version": "0.1.0",
20
+ "version": "0.30.0",
21
21
  "type": "DeclarativeSource",
22
22
  "definitions": {
23
23
  "selector": {"extractor": {"field_path": ["items"], "type": "DpathExtractor"}, "type": "RecordSelector"},
@@ -167,9 +167,9 @@ def test_get_grouped_messages_with_logs():
167
167
  ),
168
168
  ]
169
169
  expected_logs = [
170
- {"message": "log message before the request"},
171
- {"message": "log message during the page"},
172
- {"message": "log message after the response"},
170
+ LogMessage(**{"message": "log message before the request", "level": "INFO"}),
171
+ LogMessage(**{"message": "log message during the page", "level": "INFO"}),
172
+ LogMessage(**{"message": "log message after the response", "level": "INFO"}),
173
173
  ]
174
174
 
175
175
  mock_source = make_mock_source(
@@ -513,6 +513,21 @@ def test_get_grouped_messages_given_maximum_number_of_pages_then_test_read_limit
513
513
  assert stream_read.test_read_limit_reached
514
514
 
515
515
 
516
+ def test_read_stream_returns_error_if_stream_does_not_exist():
517
+ mock_source = MagicMock()
518
+ mock_source.read.side_effect = ValueError("error")
519
+
520
+ full_config = {**CONFIG, **{"__injected_declarative_manifest": MANIFEST}}
521
+
522
+ message_grouper = MessageGrouper(MAX_PAGES_PER_SLICE, MAX_SLICES)
523
+ actual_response = message_grouper.get_message_groups(source=mock_source, config=full_config,
524
+ configured_catalog=create_configured_catalog("not_in_manifest"))
525
+
526
+ assert 1 == len(actual_response.logs)
527
+ assert "Traceback" in actual_response.logs[0].message
528
+ assert "ERROR" in actual_response.logs[0].level
529
+
530
+
516
531
  def make_mock_source(return_value: Iterator) -> MagicMock:
517
532
  mock_source = MagicMock()
518
533
  mock_source.read.return_value = return_value
@@ -104,10 +104,11 @@ def test_failed_check():
104
104
  assert expected == MockSource(check_lambda=lambda: (False, "womp womp")).check(logger, {})
105
105
 
106
106
 
107
- def test_raising_check():
107
+ def test_raising_check(mocker):
108
108
  """Tests that if a source raises an unexpected exception the appropriate connectionStatus failure message is returned."""
109
- expected = AirbyteConnectionStatus(status=Status.FAILED, message="Exception('this should fail')")
110
- assert expected == MockSource(check_lambda=lambda: exec('raise Exception("this should fail")')).check(logger, {})
109
+ check_lambda = mocker.Mock(side_effect=BaseException("this should fail"))
110
+ with pytest.raises(BaseException):
111
+ MockSource(check_lambda=check_lambda).check(logger, {})
111
112
 
112
113
 
113
114
  class MockStream(Stream):
@@ -334,10 +335,7 @@ def test_valid_full_refresh_read_with_slices(mocker):
334
335
 
335
336
  @pytest.mark.parametrize(
336
337
  "slices",
337
- [
338
- [{"1": "1"}, {"2": "2"}],
339
- [{"date": datetime.date(year=2023, month=1, day=1)}, {"date": datetime.date(year=2023, month=1, day=1)}]
340
- ]
338
+ [[{"1": "1"}, {"2": "2"}], [{"date": datetime.date(year=2023, month=1, day=1)}, {"date": datetime.date(year=2023, month=1, day=1)}]],
341
339
  )
342
340
  def test_read_full_refresh_with_slices_sends_slice_messages(mocker, slices):
343
341
  """Given the logger is debug and a full refresh, AirbyteMessages are sent for slices"""
@@ -369,7 +367,7 @@ def test_read_incremental_with_slices_sends_slice_messages(mocker):
369
367
  debug_logger.setLevel(logging.DEBUG)
370
368
  slices = [{"1": "1"}, {"2": "2"}]
371
369
  stream = MockStream(
372
- [({"sync_mode": SyncMode.incremental, "stream_slice": s, 'stream_state': {}}, [s]) for s in slices],
370
+ [({"sync_mode": SyncMode.incremental, "stream_slice": s, "stream_state": {}}, [s]) for s in slices],
373
371
  name="s1",
374
372
  )
375
373
 
File without changes
File without changes