From ccffa1108c2dfb41d816d654ec8dbc050f2119ba Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Tue, 12 Apr 2022 10:19:21 +1000 Subject: [PATCH 01/19] allow nullable container_expiration_policy --- .../source-gitlab/source_gitlab/schemas/projects.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/source-gitlab/source_gitlab/schemas/projects.json b/airbyte-integrations/connectors/source-gitlab/source_gitlab/schemas/projects.json index b440ceb148bd..e7b21178e791 100644 --- a/airbyte-integrations/connectors/source-gitlab/source_gitlab/schemas/projects.json +++ b/airbyte-integrations/connectors/source-gitlab/source_gitlab/schemas/projects.json @@ -138,7 +138,7 @@ "type": ["null", "boolean"] }, "container_expiration_policy": { - "type": "object", + "type": ["null", "object"], "properties": { "cadence": { "type": ["null", "string"] From 097297c769767a01f1ed25623369bcbda18e726a Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Tue, 12 Apr 2022 10:20:38 +1000 Subject: [PATCH 02/19] Update Dockerfile --- airbyte-integrations/connectors/source-gitlab/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/source-gitlab/Dockerfile b/airbyte-integrations/connectors/source-gitlab/Dockerfile index bad9e5b8da75..6fe64858a7bf 100644 --- a/airbyte-integrations/connectors/source-gitlab/Dockerfile +++ b/airbyte-integrations/connectors/source-gitlab/Dockerfile @@ -13,5 +13,5 @@ RUN pip install . ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.4 +LABEL io.airbyte.version=0.1.5 LABEL io.airbyte.name=airbyte/source-gitlab From d826cdaccccebef54d3c9f3c29a29adb5cde6f65 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Tue, 12 Apr 2022 10:23:42 +1000 Subject: [PATCH 03/19] Update source_definitions.yaml --- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index a2601e2c11a1..8e625e89f000 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -259,7 +259,7 @@ - name: Gitlab sourceDefinitionId: 5e6175e5-68e1-4c17-bff9-56103bbb0d80 dockerRepository: airbyte/source-gitlab - dockerImageTag: 0.1.4 + dockerImageTag: 0.1.5 documentationUrl: https://docs.airbyte.io/integrations/sources/gitlab icon: gitlab.svg sourceType: api From 8af6e79a7c29bdf5dbca9c685e700de4b6d04e50 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Tue, 12 Apr 2022 10:32:18 +1000 Subject: [PATCH 04/19] Update source_specs.yaml --- airbyte-config/init/src/main/resources/seed/source_specs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index bc267e58cf4d..0f45b058acdc 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -2552,7 +2552,7 @@ path_in_connector_config: - "credentials" - "client_secret" -- dockerImage: "airbyte/source-gitlab:0.1.4" +- dockerImage: "airbyte/source-gitlab:0.1.5" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/gitlab" connectionSpecification: From 50ae5136e2937686e7f22c42ada13e8a3edca8b2 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Tue, 12 Apr 2022 16:12:47 +1000 Subject: [PATCH 05/19] fix unspecified projects --- .../connectors/source-gitlab/source_gitlab/source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/source-gitlab/source_gitlab/source.py b/airbyte-integrations/connectors/source-gitlab/source_gitlab/source.py index d7dea49b254b..d05a71888383 100644 --- a/airbyte-integrations/connectors/source-gitlab/source_gitlab/source.py +++ b/airbyte-integrations/connectors/source-gitlab/source_gitlab/source.py @@ -43,7 +43,7 @@ def _generate_main_streams(self, config: Mapping[str, Any]) -> Tuple[GitlabStrea auth = TokenAuthenticator(token=config["private_token"]) auth_params = dict(authenticator=auth, api_url=config["api_url"]) - pids = list(filter(None, config.get("projects").split(" "))) + pids = list(filter(None, config.get("projects", "").split(" "))) gids = config.get("groups") if gids: From 5b9e863ec579699c1da7eca3faf2b0403ce87765 Mon Sep 17 00:00:00 2001 From: marcosmarxm Date: Mon, 2 May 2022 18:42:08 -0300 Subject: [PATCH 06/19] add doc update --- docs/integrations/sources/gitlab.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/integrations/sources/gitlab.md b/docs/integrations/sources/gitlab.md index 8b6259b235a3..ce17f977fe81 100644 --- a/docs/integrations/sources/gitlab.md +++ b/docs/integrations/sources/gitlab.md @@ -63,6 +63,7 @@ GitLab source is working with GitLab API v4. It can also work with self-hosted G | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------| :--- | +| 0.1.5 | 2022-05-02 | [11907](https://github.com/airbytehq/airbyte/pull/11907) | Fix null projects param and `container_expiration_policy` | | 0.1.4 | 2022-03-23 | [11140](https://github.com/airbytehq/airbyte/pull/11140) | Ingest All Accessible Groups if not Specified in Config | | 0.1.3 | 2021-12-21 | [8991](https://github.com/airbytehq/airbyte/pull/8991) | Update connector fields title/description | | 0.1.2 | 2021-10-18 | [7108](https://github.com/airbytehq/airbyte/pull/7108) | Allow all domains to be used as `api_url` | From f54698b66a782a83da1ad35a9840ddb466fd4ad3 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Mon, 20 Jun 2022 12:02:31 +1000 Subject: [PATCH 07/19] attach namespace property to stream if exists --- airbyte-cdk/python/airbyte_cdk/sources/streams/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py index 97ad28c29a54..9dfd4686c9b5 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py @@ -112,6 +112,9 @@ def get_json_schema(self) -> Mapping[str, Any]: def as_airbyte_stream(self) -> AirbyteStream: stream = AirbyteStream(name=self.name, json_schema=dict(self.get_json_schema()), supported_sync_modes=[SyncMode.full_refresh]) + if self.namespace: + stream.namespace = self.namespace + if self.supports_incremental: stream.source_defined_cursor = self.source_defined_cursor stream.supported_sync_modes.append(SyncMode.incremental) # type: ignore From 086c7e3ba9593efb49430862ae77565a2797ed7e Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Thu, 23 Jun 2022 13:10:34 +1000 Subject: [PATCH 08/19] rework namespace location in stream --- airbyte-cdk/python/airbyte_cdk/sources/streams/core.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py index 9dfd4686c9b5..baf0c7dee515 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py @@ -110,10 +110,7 @@ def get_json_schema(self) -> Mapping[str, Any]: return ResourceSchemaLoader(package_name_from_class(self.__class__)).get_schema(self.name) def as_airbyte_stream(self) -> AirbyteStream: - stream = AirbyteStream(name=self.name, json_schema=dict(self.get_json_schema()), supported_sync_modes=[SyncMode.full_refresh]) - - if self.namespace: - stream.namespace = self.namespace + stream = AirbyteStream(name=self.name, json_schema=dict(self.get_json_schema()), supported_sync_modes=[SyncMode.full_refresh], namespace=self.namespace) if self.supports_incremental: stream.source_defined_cursor = self.source_defined_cursor From 7ca925ec5e18f42667b10603877e157ec7342613 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Thu, 23 Jun 2022 15:19:54 +1000 Subject: [PATCH 09/19] add namespace property to stream --- .../python/airbyte_cdk/sources/streams/core.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py index baf0c7dee515..b770b4937d50 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py @@ -110,8 +110,11 @@ def get_json_schema(self) -> Mapping[str, Any]: return ResourceSchemaLoader(package_name_from_class(self.__class__)).get_schema(self.name) def as_airbyte_stream(self) -> AirbyteStream: - stream = AirbyteStream(name=self.name, json_schema=dict(self.get_json_schema()), supported_sync_modes=[SyncMode.full_refresh], namespace=self.namespace) - + stream = AirbyteStream(name=self.name, json_schema=dict(self.get_json_schema()), supported_sync_modes=[SyncMode.full_refresh]) + + if self.namespace and self.namespace != "": + stream.namespace = self.namespace + if self.supports_incremental: stream.source_defined_cursor = self.source_defined_cursor stream.supported_sync_modes.append(SyncMode.incremental) # type: ignore @@ -141,6 +144,14 @@ def cursor_field(self) -> Union[str, List[str]]: """ return [] + @property + def namespace(self) -> Optional[str]: + """ + Override to return the namespace of this stream, e.g. the Postgres schema which this stream will emit records for. + :return: A string containing the name of the namespace. + """ + return None + @property def source_defined_cursor(self) -> bool: """ From 03c34579aee8c7c43aad15ec7af3b035aafaf684 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Thu, 23 Jun 2022 15:27:40 +1000 Subject: [PATCH 10/19] add tests for namespace --- .../sources/streams/test_streams_core.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py index df01edc17ea0..1770b3f36525 100644 --- a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py +++ b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py @@ -98,7 +98,34 @@ def test_supports_incremental_cursor_not_set(): assert not test_stream.supports_incremental +def test_namespace_set(): + """ + Should allow namespace property to be set. + """ + test_stream = StreamStubFullRefresh() + test_stream.namespace = "test_namespace" + + assert test_stream.namespace == "test_namespace" + +def test_namespace_set_to_empty_string(): + """ + Should not set namespace property if equal to empty string. + """ + test_stream = StreamStubFullRefresh() + test_stream.namespace = "" + + assert test_stream.namespace == None + +def test_namespace_not_set(): + """ + Should be equal to unset value of None. + """ + test_stream = StreamStubFullRefresh() + + assert test_stream.namespace == None + + @pytest.mark.parametrize( "test_input, expected", [("key", [["key"]]), (["key1", "key2"], [["key1"], ["key2"]]), ([["key1", "key2"], ["key3"]], [["key1", "key2"], ["key3"]])], From edb6ed51e73c39c26b287fb14fa11a9e4d4368a5 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Thu, 23 Jun 2022 15:28:39 +1000 Subject: [PATCH 11/19] make consistent spacing --- .../unit_tests/sources/streams/test_streams_core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py index 1770b3f36525..40df4f7227e2 100644 --- a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py +++ b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py @@ -98,6 +98,7 @@ def test_supports_incremental_cursor_not_set(): assert not test_stream.supports_incremental + def test_namespace_set(): """ Should allow namespace property to be set. @@ -107,6 +108,7 @@ def test_namespace_set(): assert test_stream.namespace == "test_namespace" + def test_namespace_set_to_empty_string(): """ Should not set namespace property if equal to empty string. @@ -115,7 +117,8 @@ def test_namespace_set_to_empty_string(): test_stream.namespace = "" assert test_stream.namespace == None - + + def test_namespace_not_set(): """ Should be equal to unset value of None. @@ -124,8 +127,7 @@ def test_namespace_not_set(): assert test_stream.namespace == None - - + @pytest.mark.parametrize( "test_input, expected", [("key", [["key"]]), (["key1", "key2"], [["key1"], ["key2"]]), ([["key1", "key2"], ["key3"]], [["key1", "key2"], ["key3"]])], From 68f7433c72e0e0597ac589aaac011b20a713dd0a Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Thu, 23 Jun 2022 15:36:19 +1000 Subject: [PATCH 12/19] test as_airbyte_stream() method --- .../python/unit_tests/sources/streams/test_streams_core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py index 40df4f7227e2..11903b928a95 100644 --- a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py +++ b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py @@ -57,6 +57,7 @@ def read_records( cursor_field = "test_cursor" primary_key = "primary_key" + namespace = "test_namespace" def test_as_airbyte_stream_incremental(mocker): @@ -71,6 +72,7 @@ def test_as_airbyte_stream_incremental(mocker): exp = AirbyteStream( name="stream_stub_incremental", + namespace="test_namespace", json_schema={}, supported_sync_modes=[SyncMode.full_refresh, SyncMode.incremental], default_cursor_field=["test_cursor"], From 2db5885478900bf2979e7a45030b5dafaee83e94 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Thu, 23 Jun 2022 16:07:42 +1000 Subject: [PATCH 13/19] Update CHANGELOG.md --- airbyte-cdk/python/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/airbyte-cdk/python/CHANGELOG.md b/airbyte-cdk/python/CHANGELOG.md index 17118852e5ff..19f01952cb50 100644 --- a/airbyte-cdk/python/CHANGELOG.md +++ b/airbyte-cdk/python/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.1.61 +- Define `namespace` property on the `Stream` class inside `core.py`. + ## 0.1.60 - Add `requests.exceptions.ChunkedEncodingError` to transient errors so it could be retried From 9e13429464a02dc6d1af6b44347d1771c1172e20 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Fri, 24 Jun 2022 07:38:22 +0200 Subject: [PATCH 14/19] bump version in setup.py --- airbyte-cdk/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-cdk/python/setup.py b/airbyte-cdk/python/setup.py index 53ef5967d6d9..64f8a66f7480 100644 --- a/airbyte-cdk/python/setup.py +++ b/airbyte-cdk/python/setup.py @@ -15,7 +15,7 @@ setup( name="airbyte-cdk", - version="0.1.62", + version="0.1.63", description="A framework for writing Airbyte Connectors.", long_description=README, long_description_content_type="text/markdown", From 0bc2972df6d01b3b5ff29ef34ce7485718940ae3 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Fri, 24 Jun 2022 15:39:31 +1000 Subject: [PATCH 15/19] Update airbyte-cdk/python/airbyte_cdk/sources/streams/core.py Co-authored-by: Augustin --- airbyte-cdk/python/airbyte_cdk/sources/streams/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py index b770b4937d50..f960f0f2f901 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py @@ -112,7 +112,7 @@ def get_json_schema(self) -> Mapping[str, Any]: def as_airbyte_stream(self) -> AirbyteStream: stream = AirbyteStream(name=self.name, json_schema=dict(self.get_json_schema()), supported_sync_modes=[SyncMode.full_refresh]) - if self.namespace and self.namespace != "": + if self.namespace: stream.namespace = self.namespace if self.supports_incremental: From 8cdfd17a3a137b7556e3d7b7e39c7fe401e94344 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Fri, 24 Jun 2022 08:50:07 +0200 Subject: [PATCH 16/19] format --- airbyte-cdk/python/airbyte_cdk/sources/streams/core.py | 6 +++--- .../python/unit_tests/sources/streams/test_streams_core.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py index f960f0f2f901..02199df40c31 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/streams/core.py @@ -111,10 +111,10 @@ def get_json_schema(self) -> Mapping[str, Any]: def as_airbyte_stream(self) -> AirbyteStream: stream = AirbyteStream(name=self.name, json_schema=dict(self.get_json_schema()), supported_sync_modes=[SyncMode.full_refresh]) - + if self.namespace: stream.namespace = self.namespace - + if self.supports_incremental: stream.source_defined_cursor = self.source_defined_cursor stream.supported_sync_modes.append(SyncMode.incremental) # type: ignore @@ -151,7 +151,7 @@ def namespace(self) -> Optional[str]: :return: A string containing the name of the namespace. """ return None - + @property def source_defined_cursor(self) -> bool: """ diff --git a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py index 11903b928a95..c5b6be1c7df2 100644 --- a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py +++ b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py @@ -118,7 +118,7 @@ def test_namespace_set_to_empty_string(): test_stream = StreamStubFullRefresh() test_stream.namespace = "" - assert test_stream.namespace == None + assert test_stream.namespace is None def test_namespace_not_set(): @@ -127,7 +127,7 @@ def test_namespace_not_set(): """ test_stream = StreamStubFullRefresh() - assert test_stream.namespace == None + assert test_stream.namespace is None @pytest.mark.parametrize( From 907a626d37ba921a5ac6b2e3505fbec92f9f89b9 Mon Sep 17 00:00:00 2001 From: jordan-glitch <65691557+jordan-glitch@users.noreply.github.com> Date: Mon, 27 Jun 2022 12:49:18 +1000 Subject: [PATCH 17/19] update namespace tests --- .../sources/streams/test_streams_core.py | 40 ++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py index c5b6be1c7df2..8b17b9d1aba3 100644 --- a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py +++ b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py @@ -60,6 +60,25 @@ def read_records( namespace = "test_namespace" +class StreamStubIncrementalEmptyNamespace(Stream): + """ + Stub full incremental class, with empty namespace, to assist with testing. + """ + + def read_records( + self, + sync_mode: SyncMode, + cursor_field: List[str] = None, + stream_slice: Mapping[str, Any] = None, + stream_state: Mapping[str, Any] = None, + ) -> Iterable[Mapping[str, Any]]: + pass + + cursor_field = "test_cursor" + primary_key = "primary_key" + namespace = "" + + def test_as_airbyte_stream_incremental(mocker): """ Should return an incremental refresh AirbyteStream with information matching @@ -105,20 +124,29 @@ def test_namespace_set(): """ Should allow namespace property to be set. """ - test_stream = StreamStubFullRefresh() - test_stream.namespace = "test_namespace" + test_stream = StreamStubIncremental() assert test_stream.namespace == "test_namespace" -def test_namespace_set_to_empty_string(): +def test_namespace_set_to_empty_string(mocker): """ Should not set namespace property if equal to empty string. """ - test_stream = StreamStubFullRefresh() - test_stream.namespace = "" + test_stream = StreamStubIncremental() - assert test_stream.namespace is None + mocker.patch.object(StreamStubIncremental, "get_json_schema", return_value={}) + airbyte_stream = test_stream.as_airbyte_stream() + + exp = AirbyteStream( + name="stream_stub_incremental", + json_schema={}, + supported_sync_modes=[SyncMode.full_refresh, SyncMode.incremental], + default_cursor_field=["test_cursor"], + source_defined_cursor=True, + source_defined_primary_key=[["primary_key"]], + ) + assert exp == airbyte_stream def test_namespace_not_set(): From c869fbdf133984bb0d7beed4f7bf9c308d6feca7 Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 4 Jul 2022 17:11:34 +0200 Subject: [PATCH 18/19] fix test_namespace_set_to_empty_string --- .../python/unit_tests/sources/streams/test_streams_core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py index 8b17b9d1aba3..2fd7c14e200f 100644 --- a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py +++ b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py @@ -136,6 +136,8 @@ def test_namespace_set_to_empty_string(mocker): test_stream = StreamStubIncremental() mocker.patch.object(StreamStubIncremental, "get_json_schema", return_value={}) + mocker.patch.object(StreamStubIncremental, "namespace", "") + airbyte_stream = test_stream.as_airbyte_stream() exp = AirbyteStream( From 71bc9f8812310ad2ba83058f516aae4620ff532c Mon Sep 17 00:00:00 2001 From: alafanechere Date: Mon, 4 Jul 2022 18:02:28 +0200 Subject: [PATCH 19/19] fix test_namespace_set_to_empty_string --- .../python/unit_tests/sources/streams/test_streams_core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py index 2fd7c14e200f..82fe96d412c2 100644 --- a/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py +++ b/airbyte-cdk/python/unit_tests/sources/streams/test_streams_core.py @@ -147,6 +147,7 @@ def test_namespace_set_to_empty_string(mocker): default_cursor_field=["test_cursor"], source_defined_cursor=True, source_defined_primary_key=[["primary_key"]], + namespace=None, ) assert exp == airbyte_stream