File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
resources/source_pokeapi_w_components_py
source_declarative_manifest Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1+ """A sample implementation of custom components that does nothing but will cause syncs to fail if missing."""
2+
3+ from collections .abc import Iterable , MutableMapping
4+ from typing import Any
5+
6+ import requests
7+
8+ from airbyte_cdk .sources .declarative .extractors import DpathExtractor
9+
10+
11+ class IntentionalException (Exception ):
12+ """This exception is raised intentionally in order to test error handling."""
13+
14+
15+ class MyCustomExtractor (DpathExtractor ):
16+ """Dummy class, intentionally raises an exception when extract_records is called."""
17+
18+ def extract_records (
19+ self ,
20+ response : requests .Response ,
21+ ) -> Iterable [MutableMapping [Any , Any ]]:
22+ """Raise an exception when called."""
23+ raise IntentionalException ("This is an intentional failure for testing purposes." )
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def sample_method(self) -> str:
4545
4646
4747def get_fixture_path (file_name ) -> str :
48- return os . path . join ( os . path . dirname ( __file__ ), file_name )
48+ return Path ( __file__ ). parent . parent / file_name
4949
5050
5151def test_components_module_from_string () -> None :
You can’t perform that action at this time.
0 commit comments