Skip to content

Commit 606c23c

Browse files
authored
Merge branch 'main' into lmossman/refactor-request-option
2 parents 5bee970 + 7a81b3b commit 606c23c

File tree

2 files changed

+38
-40
lines changed

2 files changed

+38
-40
lines changed

airbyte_cdk/cli/airbyte_cdk/_connector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
TEST_FILE_TEMPLATE = '''
6565
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
66-
"""FAST Airbyte Standard Tests for the source_pokeapi_w_components source."""
66+
"""FAST Airbyte Standard Tests for the {connector_name} source."""
6767
6868
#from airbyte_cdk.test.standard_tests import {base_class_name}
6969
from airbyte_cdk.test.standard_tests.util import create_connector_test_suite
@@ -78,7 +78,7 @@
7878
)
7979
8080
# class TestSuite({base_class_name}):
81-
# """Test suite for the source_pokeapi_w_components source.
81+
# """Test suite for the {connector_name} source.
8282
8383
# This class inherits from SourceTestSuiteBase and implements all of the tests in the suite.
8484
@@ -152,7 +152,7 @@ def test(
152152

153153
file_text = TEST_FILE_TEMPLATE.format(
154154
base_class_name=connector_test_suite.__bases__[0].__name__,
155-
connector_directory=str(connector_directory),
155+
connector_name=connector_name,
156156
)
157157
test_file_path = Path() / ".tmp" / "integration_tests/test_airbyte_standards.py"
158158
test_file_path = test_file_path.resolve().absolute()

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,8 +2080,8 @@ class Config:
20802080
CustomAuthenticator,
20812081
OAuthAuthenticator,
20822082
JwtAuthenticator,
2083-
NoAuth,
20842083
SessionTokenAuthenticator,
2084+
NoAuth,
20852085
LegacySessionTokenAuthenticator,
20862086
],
20872087
] = Field(
@@ -2103,15 +2103,15 @@ class Config:
21032103

21042104
class FileUploader(BaseModel):
21052105
type: Literal["FileUploader"]
2106-
requester: Union[CustomRequester, HttpRequester] = Field(
2106+
requester: Union[HttpRequester, CustomRequester] = Field(
21072107
...,
21082108
description="Requester component that describes how to prepare HTTP requests to send to the source API.",
21092109
)
2110-
download_target_extractor: Union[CustomRecordExtractor, DpathExtractor] = Field(
2110+
download_target_extractor: Union[DpathExtractor, CustomRecordExtractor] = Field(
21112111
...,
21122112
description="Responsible for fetching the url where the file is located. This is applied on each records and not on the HTTP response",
21132113
)
2114-
file_extractor: Optional[Union[CustomRecordExtractor, DpathExtractor]] = Field(
2114+
file_extractor: Optional[Union[DpathExtractor, CustomRecordExtractor]] = Field(
21152115
None,
21162116
description="Responsible for fetching the content of the file. If not defined, the assumption is that the whole response body is the file content",
21172117
)
@@ -2144,9 +2144,7 @@ class Config:
21442144
description="Component used to fetch data incrementally based on a time field in the data.",
21452145
title="Incremental Sync",
21462146
)
2147-
primary_key: Optional[PrimaryKey] = Field(
2148-
"", description="The primary key of the stream.", title="Primary Key"
2149-
)
2147+
primary_key: Optional[PrimaryKey] = Field("", title="Primary Key")
21502148
schema_loader: Optional[
21512149
Union[
21522150
InlineSchemaLoader,
@@ -2242,7 +2240,7 @@ class HttpRequester(BaseModelWithDeprecations):
22422240
None,
22432241
deprecated=True,
22442242
deprecation_message="Use `url` field instead.",
2245-
description="Deprecated, use the `url` instead. Base URL of the API source. Do not put sensitive information (e.g. API tokens) into this field - Use the Authentication component for this.",
2243+
description="Deprecated, use the `url` instead. Base URL of the API source. Do not put sensitive information (e.g. API tokens) into this field - Use the Authenticator component for this.",
22462244
examples=[
22472245
"https://connect.squareup.com/v2",
22482246
"{{ config['base_url'] or 'https://app.posthog.com'}}/api",
@@ -2253,20 +2251,20 @@ class HttpRequester(BaseModelWithDeprecations):
22532251
)
22542252
url: Optional[str] = Field(
22552253
None,
2256-
description="The URL of the API source. Do not put sensitive information (e.g. API tokens) into this field - Use the Authentication component for this.",
2254+
description="The URL of the source API endpoint. Do not put sensitive information (e.g. API tokens) into this field - Use the Authenticator component for this.",
22572255
examples=[
22582256
"https://connect.squareup.com/v2",
22592257
"{{ config['url'] or 'https://app.posthog.com'}}/api",
22602258
"https://connect.squareup.com/v2/quotes/{{ stream_partition['id'] }}/quote_line_groups",
22612259
"https://example.com/api/v1/resource/{{ next_page_token['id'] }}",
22622260
],
2263-
title="The URL of an API endpoint",
2261+
title="API Endpoint URL",
22642262
)
22652263
path: Optional[str] = Field(
22662264
None,
22672265
deprecated=True,
22682266
deprecation_message="Use `url` field instead.",
2269-
description="Deprecated, use the `url` instead. Path the specific API endpoint that this stream represents. Do not put sensitive information (e.g. API tokens) into this field - Use the Authentication component for this.",
2267+
description="Deprecated, use the `url` instead. Path the specific API endpoint that this stream represents. Do not put sensitive information (e.g. API tokens) into this field - Use the Authenticator component for this.",
22702268
examples=[
22712269
"/products",
22722270
"/quotes/{{ stream_partition['id'] }}/quote_line_groups",
@@ -2282,7 +2280,6 @@ class HttpRequester(BaseModelWithDeprecations):
22822280
)
22832281
authenticator: Optional[
22842282
Union[
2285-
NoAuth,
22862283
ApiKeyAuthenticator,
22872284
BasicHttpAuthenticator,
22882285
BearerAuthenticator,
@@ -2291,6 +2288,7 @@ class HttpRequester(BaseModelWithDeprecations):
22912288
SessionTokenAuthenticator,
22922289
SelectiveAuthenticator,
22932290
CustomAuthenticator,
2291+
NoAuth,
22942292
LegacySessionTokenAuthenticator,
22952293
]
22962294
] = Field(
@@ -2303,6 +2301,25 @@ class HttpRequester(BaseModelWithDeprecations):
23032301
description="Allows for retrieving a dynamic set of properties from an API endpoint which can be injected into outbound request using the stream_partition.extra_fields.",
23042302
title="Fetch Properties from Endpoint",
23052303
)
2304+
request_parameters: Optional[Union[Dict[str, Union[str, QueryProperties]], str]] = Field(
2305+
None,
2306+
description="Specifies the query parameters that should be set on an outgoing HTTP request given the inputs.",
2307+
examples=[
2308+
{"unit": "day"},
2309+
{
2310+
"query": 'last_event_time BETWEEN TIMESTAMP "{{ stream_interval.start_time }}" AND TIMESTAMP "{{ stream_interval.end_time }}"'
2311+
},
2312+
{"searchIn": "{{ ','.join(config.get('search_in', [])) }}"},
2313+
{"sort_by[asc]": "updated_at"},
2314+
],
2315+
title="Query Parameters",
2316+
)
2317+
request_headers: Optional[Union[Dict[str, str], str]] = Field(
2318+
None,
2319+
description="Return any non-auth headers. Authentication headers will overwrite any overlapping headers returned from this method.",
2320+
examples=[{"Output-Format": "JSON"}, {"Version": "{{ config['version'] }}"}],
2321+
title="Request Headers",
2322+
)
23062323
request_body_data: Optional[Union[Dict[str, str], str]] = Field(
23072324
None,
23082325
deprecated=True,
@@ -2363,26 +2380,7 @@ class HttpRequester(BaseModelWithDeprecations):
23632380
},
23642381
},
23652382
],
2366-
title="Request Body Payload to be send as a part of the API request.",
2367-
)
2368-
request_headers: Optional[Union[Dict[str, str], str]] = Field(
2369-
None,
2370-
description="Return any non-auth headers. Authentication headers will overwrite any overlapping headers returned from this method.",
2371-
examples=[{"Output-Format": "JSON"}, {"Version": "{{ config['version'] }}"}],
2372-
title="Request Headers",
2373-
)
2374-
request_parameters: Optional[Union[Dict[str, Union[str, QueryProperties]], str]] = Field(
2375-
None,
2376-
description="Specifies the query parameters that should be set on an outgoing HTTP request given the inputs.",
2377-
examples=[
2378-
{"unit": "day"},
2379-
{
2380-
"query": 'last_event_time BETWEEN TIMESTAMP "{{ stream_interval.start_time }}" AND TIMESTAMP "{{ stream_interval.end_time }}"'
2381-
},
2382-
{"searchIn": "{{ ','.join(config.get('search_in', [])) }}"},
2383-
{"sort_by[asc]": "updated_at"},
2384-
],
2385-
title="Query Parameters",
2383+
title="Request Body",
23862384
)
23872385
error_handler: Optional[
23882386
Union[DefaultErrorHandler, CompositeErrorHandler, CustomErrorHandler]
@@ -2475,7 +2473,7 @@ class PropertiesFromEndpoint(BaseModel):
24752473
description="Describes the path to the field that should be extracted",
24762474
examples=[["name"]],
24772475
)
2478-
retriever: Union[CustomRetriever, SimpleRetriever] = Field(
2476+
retriever: Union[SimpleRetriever, CustomRetriever] = Field(
24792477
...,
24802478
description="Requester component that describes how to fetch the properties to query from a remote API endpoint.",
24812479
)
@@ -2526,19 +2524,19 @@ class SimpleRetriever(BaseModel):
25262524
)
25272525
decoder: Optional[
25282526
Union[
2529-
CsvDecoder,
2530-
GzipDecoder,
25312527
JsonDecoder,
2528+
XmlDecoder,
2529+
CsvDecoder,
25322530
JsonlDecoder,
2531+
GzipDecoder,
25332532
IterableDecoder,
2534-
XmlDecoder,
25352533
ZipfileDecoder,
25362534
CustomDecoder,
25372535
]
25382536
] = Field(
25392537
None,
25402538
description="Component decoding the response so records can be extracted.",
2541-
title="Decoder",
2539+
title="HTTP Response Format",
25422540
)
25432541
record_selector: RecordSelector = Field(
25442542
...,

0 commit comments

Comments
 (0)