1
0
mirror of synced 2025-12-31 15:03:11 -05:00
Commit Graph

538 Commits

Author SHA1 Message Date
Alexandre Girard
df72bbdf2c Low-code: Pass stream_slice to read_records when reading from CheckStream (#17804)
* Implement a test

* Implement fix

* rename

* extract method

* bump
2022-10-17 05:47:56 -07:00
Alexandre Girard
62500af93b get module name from sys.modules (#17779)
* get module name from sys.modules

* bump

* fix comment

* throw exception

* fix unittests

* Add missing files

* remove debug prints

* indent
2022-10-10 13:54:09 -07:00
Alexandre Girard
89a9d6497a Add missing types to the registry (#17763)
* Add missing types to the registry

* bump
2022-10-09 01:25:38 -07:00
Alexandre Girard
39220f4b1e Update lowcode docs (#17752)
* Update lowcode docs

* Update

* fix links

* more links

* Schemas

* indent

* Update docs/connector-development/config-based/advanced-topics.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/advanced-topics.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/low-code-cdk-overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/understanding-the-yaml-file/request-options.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/understanding-the-yaml-file/requester.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/understanding-the-yaml-file/stream-slicers.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/understanding-the-yaml-file/requester.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/understanding-the-yaml-file/error-handling.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* capitalization

* fix schema

* fix schema

* small changes so greenhouse validates

* fix brackets

* update code samples

* Add missing types

* fix

* reset

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>
2022-10-07 19:15:27 -07:00
Alexandre Girard
18da341b91 Revert: #17047 Airbyte CDK: Improve error for returning non-iterable from connectors parse_response (#17707)
* Bump cdk version

* Revert "#17047 Airbyte CDK: Improve error for returning non-iterable from connectors parse_response (#17626)"

This reverts commit d9ad2725b1.

* Bump
2022-10-06 18:43:01 -07:00
Robert
d9ad2725b1 #17047 Airbyte CDK: Improve error for returning non-iterable from connectors parse_response (#17626)
* Improve airbyte cdk invalid message data type error message

* Test cdk invalid message data type custom error is raised

* Fix test to pass stream as a string

* Add valid record message data input type test

* Add object type and value to AirbyteRecordMessage validator message

Co-authored-by: Alexandre Girard <alexandre@airbyte.io>
2022-10-06 16:46:33 -07:00
Alexandre Girard
20ae75e4ee 🐛 : Add missing component types to the types registry (#17700)
* Add page increment to type registry

* Add page increment to type registry
2022-10-06 15:01:58 -07:00
Alexandre Girard
65be9b74f0 Simplify low-code connectors template (#17476)
* default schema loader

* Update generator

* update example

* remove more cruft

* Update code sampels in section 3 (but not the text)

* Update code sampels in 5

* Update instructions

* Update code samples

* Update samples

* Use now_utc instead of local

* isolate complexity to JsonSchema

* Bump cdk version

* Update changelog

* fix unit test

* slightly more helpful default

* Don't freeze cdk version in template

* remove newline

* newline

* bump

* Update changelog

* Bump
2022-10-06 08:12:21 -07:00
Alexandre Girard
3bdd7f4f43 Standardize HttpRequester's url_base and path format (#17524)
* add trailing slash to base url if missing

* remove leading / from path

* Bump
2022-10-05 15:30:37 -07:00
Alexandre Girard
61a5a1e967 [#17107] Fix propagation of $options field in arrays (#17196)
* input can only be a string

* remove debug print

* cleanup tests

* fix in the factory

* Add a unit test

* fix for lists

* Update changelog

* Update changelog
2022-10-03 17:02:41 -07:00
Alexandre Girard
4b0fb6787e [low-code] Apply log level to stream loggers (#17284)
* Apply log level to stream loggers

* remove debug print
2022-09-30 12:49:08 -07:00
Alexandre Girard
d6b79b8e52 Alex/limit paginator (#17197)
* remove page size from limit paginator

* Rename LimitPaginator to DefaultPaginator

* rename limit_options

* rename method

* cleanup

* comment

* update schema file

* Update changelog

* pin greenhouse connector

* fix doc in comment

* fix changelog

* missing -

* bump

* bump
2022-09-29 19:24:53 -07:00
Pedro S. Lopez
58f5128adb 🐞 CDK: fix error when logging warning for types that could not be transformed (#17367)
* fix error when logging warning for types that could not be transformed

* changelog and bump
2022-09-29 18:48:53 -04:00
Pedro S. Lopez
fe2238f3f7 🐞 CDK: properly emit state on empty slices when using iterators (#17296)
* fix: emit state on empty slices iterator

* bump version / update changelog

* format
2022-09-28 02:12:04 -04:00
Serhii Chvaliuk
a82f59ec1e CDK: Evaluate response.text only in debug mode (#16809)
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
2022-09-17 12:12:03 +03:00
Brian Lai
f283652313 [per-stream cdk] Emit per-stream state messages (#16628)
* update abstract source and connector state manager to update shared and stream state

* clean up some extra comments and extra lines

* a few changes based on PR feedback

* remove separate legacy map from state manager and simplify mapping to descriptor -> state blob

* rename a few paramets and add testing for state update via stream.state override

* replace shared_state processing with an explicit error and fix a few comments and pr feedback

* add some polish and additional test cases

* Add create_state_message to manager and emit per-stream state for connectors

* pr feedback and restructuring parts of the connector state manager initialization

* fix unfinished comment

* Update airbyte-cdk/python/unit_tests/sources/test_abstract_source.py

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* use pytest params to annotate tests better

* change to fix changed class name

* format test params a little better

* Update airbyte-cdk/python/airbyte_cdk/sources/connector_state_manager.py

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* a few bits of pr feedback

* do not emit namespace in the outbound message if it is None

* fix some issues w/ prior merge from master and pr feedback

* add new tests to ensure we never send None namespace to the platform

* bump CDK version number

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>
Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
2022-09-15 23:42:49 -04:00
Brian Lai
db56c75f03 [per-stream cdk] Allow for reading in per-stream state and passing it to connectors (#16505)
* update abstract source and connector state manager to update shared and stream state

* clean up some extra comments and extra lines

* a few changes based on PR feedback

* remove separate legacy map from state manager and simplify mapping to descriptor -> state blob

* rename a few paramets and add testing for state update via stream.state override

* replace shared_state processing with an explicit error and fix a few comments and pr feedback

* add some polish and additional test cases

* pr feedback and restructuring parts of the connector state manager initialization

* fix unfinished comment

* Update airbyte-cdk/python/unit_tests/sources/test_abstract_source.py

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* use pytest params to annotate tests better

* change to fix changed class name

* Update airbyte-cdk/python/airbyte_cdk/sources/connector_state_manager.py

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* a few bits of pr feedback

* pr feedback and cleaning up some comments and variable renames

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>
Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
2022-09-15 15:55:46 -04:00
Serhii Chvaliuk
74e936bf7d CDK: improve TypeTransformer to convert simple types to array of simple types (#16636)
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
2022-09-15 11:34:17 +03:00
Serhii Chvaliuk
0d55a895cb CDK: TypeTransformer - warning message more informative (#16695)
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
2022-09-15 10:24:37 +03:00
Serhii Chvaliuk
5a3b6d82b6 CDK: make TypeTransformer more robust to incorrect incoming records (#16544)
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
2022-09-13 10:30:16 +03:00
Evan Tahler
dcfcb75d0f AirbyteLogMessage.stack_trace for logging messages with related (non-fatal) errors (#16479)
* Test log message from faker

* AirbyteLogMessage gains stack_trace

* Fixup spacing

* bump python protocol

* fixup additionalProperties in faker spec

* bump faker version

* update docs

* use lineSeparator vs \r\n

* auto-bump connector version [ci skip]

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-09-12 16:01:57 -07:00
Brian Lai
6253406de9 forgot to also emit dictionary instead of empty lists when state not specified (#16569) 2022-09-12 17:45:48 -04:00
Brian Lai
037e8ed1a9 fix cdk bug to send legacy format if connector overrides read() (#16566)
* fix cdk bug to send legacy format if connector overrides read()

* fix comment

* update changelog and setup.py
2022-09-09 21:09:50 -04:00
Alexandre Girard
0cb44ca071 release cdk with frozen dataclasses-jsonschema lib (#16525) 2022-09-09 07:03:18 -07:00
Brian Lai
1d9608cbbe [per-stream cdk] Support deserialization of legacy and per-stream state (#16205)
* interpret legacy and new per-stream format into AirbyteStateMessages

* add ConnectorStateManager stubs for future work

* remove frozen for the time being until we need to hash descriptors

* add validation that AirbyteStateMessage has at least one of stream, global, or data fields

* pr feedback and clean up of the code

* remove changes to airbyte_protocol and perform validation in read_state()

* fix import formatting
2022-09-07 13:20:14 -04:00
Brian Lai
dceeef4683 [cdk] pin dataclasses-jsonschema to 2.15.1 (#16253) 2022-09-01 21:08:32 -04:00
Serhii Chvaliuk
3cfa489234 CDK: Fix regression in _checkpoint_state arg (#16141)
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
2022-08-31 22:39:30 +03:00
Jimmy Ma
4fbe03bebe Add explicit tracking of Airbyte Protocol Version in ConnectorSpecification (#15340)
* Add Version to AirbyteMessage

* Move protocol version to ConnectorSpecification

* Add cdk generated protocol model

* Add protocol_version to the sample ConnectorSpec in the docs

* Update airbyte-protocol/protocol-models/src/main/resources/airbyte_protocol/airbyte_protocol.yaml

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* update doc

* Update CDK changelog

* Update CDK protocol model

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
2022-08-29 14:46:56 -07:00
Brian Lai
10a2bd1d3c [low code connectors] add NoAuth to class types registry (#15939)
* add no auth to class type registry

* NoAuth should receive options and fail normally

* forgot to pass options in

* update changelog
2022-08-25 18:06:02 -04:00
Brian Lai
09cddffd36 [low code connectors] replace file retrieval with pkgutil to fix getting schema files (#15814)
* replace file retrieval with pkgutil to fix getting schema files

* slightly better error handling on missing files

* filter our schema gen warnings for some classes that cannot generate schemas

* add comment for todo

* add changelog and setup before publish
2022-08-23 03:06:20 -04:00
Brian Lai
ca6513625d [low code connectors] read configs from package_data (#15810)
* read configs from package_data

* update changelog and setup

* commenting out failing tests in the short term
2022-08-19 21:16:20 -04:00
Brian Lai
7e158ef9af [low code connectors] generate complete json schema from classes (#15647)
* draft: first pass at complete schema language generation and factory validator

* actually a working validator and fixes to the schema that went uncaught

* remove extra spike file

* fix formatting file

* Add method to generate the complete JSON schema of the low code declarative language

* add testing of a few components during schema gen

* pr feedback and a little bit of refactoring

* test for schema version

* fix some types that were erroneously marked as invalid schema

* some comments

* add jsonschemamixin to interfaces

* update tests now that interfaces are jsonschemamixin

* accidentally removed a mixin

* remove unneeded test

* make comment a little more clear

* update changelog

* bump version

* generic enum not enum class

* Add method to generate the complete JSON schema of the low code declarative language

* add testing of a few components during schema gen

* test for schema version

* update tests now that interfaces are jsonschemamixin

* accidentally removed a mixin

* remove unneeded test

* make comment a little more clear

* generic enum not enum class

* add generated json file and update docs to reference it

* verbage
2022-08-18 18:53:42 -04:00
Brian Lai
ca80d3782a [low code connectors] perform schema validation of the input config against the declarative language schema (#15543)
* draft: first pass at complete schema language generation and factory validator

* actually a working validator and fixes to the schema that went uncaught

* remove extra spike file

* fix formatting file

* pr feedback and a little bit of refactoring

* fix some types that were erroneously marked as invalid schema

* some comments

* add jsonschemamixin to interfaces

* update changelog

* bump version
2022-08-18 15:29:26 -04:00
Alexandre Girard
313ac11e6d [low-code connectors] Get parent stream's full slice (#15631)
* always access parent stream using full_refresh mode

* Update test

* fix substream slicer

* bump
2022-08-18 10:24:10 -07:00
Serhii Chvaliuk
4e6cb05759 CDK: Improve filter_secrets skip empty string (#15684)
* Improve `filter_secrets` skip empty string

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
2022-08-16 19:28:57 +03:00
Alexandre Girard
288c3cabad Tutorial and documentation for config-based connectors (#15027)
* 5-step tutorial

* move

* tiny bit of editing

* Update tutorial

* update docs

* reset

* move files

* record selector, request options, and more links

* update

* update

* connector definition

* link

* links

* update example

* footnote

* typo

* document string interpolation

* note on string interpolation

* update

* fix code sample

* fix

* update sample

* fix

* use the actual config

* Update as per comments

* write as yaml

* typo

* Clarify options overloading

* clarify that docker must be running

* remove extra footnote

* use venv directly

* Apply suggestions from code review

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* signup instructions

* update

* clarify that both dot and bracket notations are interchangeable

* Clarify how check works

* create spec and config before updating connector definition

* clarify what now_local() is

* rename to yaml structure

* Go through tutorial and update end of section code samples

* fix link

* update

* update code samples

* Update code samples

* Update to bracket notation

* remove superfluous comments

* Update docs/connector-development/config-based/tutorial/2-install-dependencies.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/4-reading-data.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* fix path

* update

* motivation blurp

* warning

* warning

* fix code block

* update code samples

* update code sample

* update code samples

* small updates

* update yaml structure

* custom class example

* language annotations

* update warning

* Update tutorial to use dpath extractor

* Update record selector docs

* unit test

* link to contributing

* tiny update

* $ in front of commands

* $ in front of commands

* More readings

* link to existing config-based connectors

* index

* update

* delete broken link

* supported features

* update

* Add some links

* Update docs/connector-development/config-based/overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/record-selector.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* mention the unit

* headers

* remove mentions of interpolating on stream slice, etc.

* update

* exclude config-based docs

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
Co-authored-by: Augustin <augustin.lafanechere@gmail.com>
Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>
2022-08-12 15:50:54 -07:00
Alexandre Girard
6332fd6527 [low-code-connectors] Replace JelloExtractor with DpathExtractor (#15514)
* Handle extracting no records from root

* handle missing keys

* record extractor interface

* dpath extractor

* docstring

* handle extract root array

* Update airbyte-cdk/python/airbyte_cdk/sources/declarative/extractors/jello.py

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* Update airbyte-cdk/python/airbyte_cdk/sources/declarative/extractors/record_selector.py

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* update docstring

* respect extractor interface

* edge case handling

* document

* use dpath by default

* delete jello extractor

* bump cdk version

* delete jello dependency

* Update reference docs templates

* update template

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
2022-08-11 12:34:54 -07:00
Alexandre Girard
29fafe26eb [low-code connectors] Extract datetime parser and handle %s format directive (#15429)
* fix parse

* Revert "fix parse"

This reverts commit 3c76c5a782.

* fix parse timestamp

* extract datetime parser

* remove print

* use parser

* top level docstring

* rename variable

* do not use timestamp()

* Revert "do not use timestamp()"

This reverts commit 016cb69193.

* update comment

* bump cdk version

* Update template
2022-08-10 16:35:29 -07:00
Alexandre Girard
f540499f43 [low-code connectors]: Assert there are no custom top-level fields (#15489)
* move components to definitions field

* Also update the references

* validate the top level fields and add version

* raise exception on unknown fields

* newline

* unit tests

* set version to 0.1.0

* newline
2022-08-10 11:37:07 -07:00
Alexandre Girard
bbf3584cb7 Remove unused field from JsonSchema (#15425)
* few fixes from working with sendgrid

* reset to master

* only update the docstring

* reset
2022-08-10 10:58:22 -07:00
Alexandre Girard
9507d56be9 low-code connectors: fix parse and format methods (#15326)
* fix parse and format methods

* define constant

* remove timestamp magic keyword

* comment

* test for ci

* uncomment test

* use timestamp()

* Bump cdk version

* bump to 0.1.72
2022-08-08 19:02:02 -07:00
Brian Lai
054cbbe94d [low code connectors] fix bug where headers were not passed to cursor interpolation (#15347)
* fix bug where headers were not passed to cursor interpolation

* add headers to error handler predicate
2022-08-08 15:23:20 -04:00
Brian Lai
ef712f18aa [low-code connectors] fix so we don't display yaml when debug flag is turned off (#15383)
* fix so we don't display yaml when debug is turned off

* forgot to remove old debug level
2022-08-08 01:11:31 -04:00
Alexandre Girard
6f1715eabe low-code connectors: convert request headers to string before submitting them (#15336)
* convert values to strings

* introduce variable

* kwargs

* bump version
2022-08-06 10:10:23 -07:00
Alexandre Girard
5242ff8e95 low-code connectors: reset pagination between stream slices (#15330)
* reset pagination between stream slices

* Update airbyte-cdk/python/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* Update airbyte-cdk/python/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* patch

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
2022-08-05 16:44:56 -07:00
Alexandre Girard
c5c13f05b4 low-code-connectors: handle single records (#15346)
* handle single records

* comment

* comment
2022-08-05 15:52:45 -07:00
Brian Lai
bd31100774 initial first pass converting every component to dataclasses (#15189)
* initial first pass converting every component to dataclasses

* replace the hackier options pass through

* get rid of the hackier way

* fix issues w/ type hints by making options required and lots of fixes to the language to fix compatability for dataclasses

* add dataclasses-jsonschema to setup

* fix oauth authenticator to avoid dataclass name collisions

* fix spacing for CI tests

* remove property from oauth and fix a interpolation bug

* pr feedback and cleaning up the code a bit, attempt at avoiding renaming

* fix templates and bugs surfaced during greenhouse spec testing

* fix tests

* fix missing options in some declarative components

* fix tests related to pulling latest master

* fix issue w/ passing state, slice, and token to subcomponents

* switch name back to get_access_token() since no name collision anymore
2022-08-05 17:39:27 -04:00
Alexandre Girard
6e59cfd7be low-code connectors: Set slicer's request options (#15283)
* requester is a request options provider

* get request options from slicer

* remove prints

* share interface

* actual fix with test

* small fix

* missing tests

* missing *

* simplify intersection logic

* bump cdk version
2022-08-04 16:18:28 -07:00
Alexandre Girard
017a092194 cast to string before passing to strptime (#15323) 2022-08-04 15:47:13 -07:00
Alexandre Girard
79a54a81fd Emit a state message even if no records were read (#15067)
* Emit a state message even if no records were read

* newline

* merge

* comment

* implement logic in the abstract source

* remove logic from declarative source

* comment

* bump cdk version
2022-08-04 12:48:21 -07:00