-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca68c5c
commit e38f914
Showing
12 changed files
with
1,046 additions
and
533 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
.../source_declarative_manifest/resources/source_pokeapi_w_components_py/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# PokeAPI with Custom `components.py` API Tests | ||
|
||
This test connector is a modified version of `source-pokeapi`. It has been modified to use custom `components.py` so we have a test case the completes quickly and _does not_ require any credentials. |
20 changes: 20 additions & 0 deletions
20
..._tests/source_declarative_manifest/resources/source_pokeapi_w_components_py/components.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""A sample implementation of custom components that does nothing but will cause syncs to fail if missing.""" | ||
|
||
from typing import Any, Mapping | ||
|
||
import requests | ||
|
||
from airbyte_cdk.sources.declarative.extractors import DpathExtractor | ||
|
||
|
||
class IntentionalException(Exception): | ||
"""This exception is raised intentionally in order to test error handling.""" | ||
|
||
|
||
class MyCustomExtractor(DpathExtractor): | ||
"""Dummy class, directly implements DPatchExtractor. | ||
Used to prove that SDM can find the custom class by name. | ||
""" | ||
|
||
pass |
24 changes: 24 additions & 0 deletions
24
...ource_declarative_manifest/resources/source_pokeapi_w_components_py/components_failing.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
# | ||
"""A sample implementation of custom components that does nothing but will cause syncs to fail if missing.""" | ||
|
||
from collections.abc import Iterable, MutableMapping | ||
from dataclasses import InitVar, dataclass | ||
from typing import Any, Mapping, Optional, Union | ||
|
||
import requests | ||
|
||
from airbyte_cdk.sources.declarative.extractors import DpathExtractor | ||
|
||
|
||
class IntentionalException(Exception): | ||
"""This exception is raised intentionally in order to test error handling.""" | ||
|
||
|
||
class MyCustomExtractor(DpathExtractor): | ||
def extract_records( | ||
self, | ||
response: requests.Response, | ||
) -> Iterable[MutableMapping[Any, Any]]: | ||
raise IntentionalException |
Oops, something went wrong.