airbyte-cdk 6.60.8__py3-none-any.whl → 6.60.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,11 +123,18 @@ def connector_cli_group() -> None:
123
123
  multiple=True,
124
124
  help="Additional argument(s) to pass to pytest. Can be specified multiple times.",
125
125
  )
126
+ @click.option(
127
+ "--no-creds",
128
+ is_flag=True,
129
+ default=False,
130
+ help="Skip tests that require credentials (marked with 'requires_creds').",
131
+ )
126
132
  def connector_test(
127
133
  connector: str | Path | None = None,
128
134
  *,
129
135
  collect_only: bool = False,
130
136
  pytest_args: list[str] | None = None,
137
+ no_creds: bool = False,
131
138
  ) -> None:
132
139
  """Run connector tests.
133
140
 
@@ -147,6 +154,9 @@ def connector_test(
147
154
  if collect_only:
148
155
  pytest_args.append("--collect-only")
149
156
 
157
+ if no_creds:
158
+ pytest_args.extend(["-m", "not requires_creds"])
159
+
150
160
  run_connector_tests(
151
161
  connector_name=connector_name,
152
162
  connector_directory=connector_directory,
@@ -100,10 +100,17 @@ def build(
100
100
  "--image",
101
101
  help="Image to test, instead of building a new one.",
102
102
  )
103
+ @click.option(
104
+ "--no-creds",
105
+ is_flag=True,
106
+ default=False,
107
+ help="Skip tests that require credentials (marked with 'requires_creds').",
108
+ )
103
109
  def image_test( # "image test" command
104
110
  connector: str | None = None,
105
111
  *,
106
112
  image: str | None = None,
113
+ no_creds: bool = False,
107
114
  ) -> None:
108
115
  """Test a connector Docker image.
109
116
 
@@ -124,7 +131,11 @@ def image_test( # "image test" command
124
131
  connector_name, connector_directory = resolve_connector_name_and_directory(connector)
125
132
 
126
133
  # Select only tests with the 'image_tests' mark
127
- pytest_args = ["-m", "image_tests"]
134
+ pytest_filter = "image_tests"
135
+ if no_creds:
136
+ pytest_filter += " and not requires_creds"
137
+
138
+ pytest_args = ["-m", pytest_filter]
128
139
  if not image:
129
140
  metadata_file_path: Path = connector_directory / "metadata.yaml"
130
141
  try:
@@ -168,7 +168,13 @@ class HttpRequester(Requester):
168
168
  next_page_token=next_page_token,
169
169
  )
170
170
 
171
- full_url = self._join_url(url_base, path) if url_base else url + path if path else url
171
+ full_url = (
172
+ self._join_url(url_base, path)
173
+ if url_base
174
+ else self._join_url(url, path)
175
+ if path
176
+ else url
177
+ )
172
178
 
173
179
  return full_url
174
180
 
@@ -159,14 +159,7 @@ class DefaultPaginator(Paginator):
159
159
  ) -> Optional[str]:
160
160
  token = next_page_token.get("next_page_token") if next_page_token else None
161
161
  if token and self.page_token_option and isinstance(self.page_token_option, RequestPath):
162
- # make additional interpolation context
163
- interpolation_context = get_interpolation_context(
164
- stream_state=stream_state,
165
- stream_slice=stream_slice,
166
- next_page_token=next_page_token,
167
- )
168
- # Replace url base to only return the path
169
- return str(token).replace(self.url_base.eval(self.config, **interpolation_context), "") # type: ignore # url_base is casted to a InterpolatedString in __post_init__
162
+ return str(token)
170
163
  else:
171
164
  return None
172
165
 
@@ -186,3 +186,8 @@ class ConnectorTestScenario(BaseModel):
186
186
  **self.model_dump(exclude={"status"}),
187
187
  status="succeed",
188
188
  )
189
+
190
+ @property
191
+ def requires_creds(self) -> bool:
192
+ """Return True if the scenario requires credentials to run."""
193
+ return bool(self.config_path and "secrets" in self.config_path.parts)
@@ -161,7 +161,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
161
161
  if test_class is None:
162
162
  return
163
163
 
164
- # Get the 'scenarios' attribute from the class
164
+ # Check that the class is compatible with our test suite
165
165
  scenarios_attr = getattr(test_class, "get_scenarios", None)
166
166
  if scenarios_attr is None:
167
167
  raise ValueError(
@@ -169,6 +169,21 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
169
169
  "Please define the 'scenarios' attribute in the test class."
170
170
  )
171
171
 
172
+ # Get the scenarios defined or discovered in the test class
172
173
  scenarios = test_class.get_scenarios()
173
- ids = [str(scenario) for scenario in scenarios]
174
- metafunc.parametrize("scenario", scenarios, ids=ids)
174
+
175
+ # Create pytest.param objects with special marks as needed
176
+ parametrized_scenarios = [
177
+ pytest.param(
178
+ scenario,
179
+ marks=[pytest.mark.requires_creds] if scenario.requires_creds else [],
180
+ )
181
+ for scenario in scenarios
182
+ ]
183
+
184
+ # Parametrize the 'scenario' argument with the scenarios
185
+ metafunc.parametrize(
186
+ "scenario",
187
+ parametrized_scenarios,
188
+ ids=[str(scenario) for scenario in scenarios],
189
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.60.8
3
+ Version: 6.60.10
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -1,8 +1,8 @@
1
1
  airbyte_cdk/__init__.py,sha256=lZNgioD1bHnzRbPK-TXjo7JOVKEL8mz9b5uflj-wIFI,12232
2
2
  airbyte_cdk/cli/__init__.py,sha256=CXsai3MYMLZ_sqi2vPAIVcKDun8VRqlv0cKffBI0iSY,346
3
3
  airbyte_cdk/cli/airbyte_cdk/__init__.py,sha256=8IoEcbdYr7CMAh97Xut5__uHH9vV4LKUtSBNTk3qEWY,2031
4
- airbyte_cdk/cli/airbyte_cdk/_connector.py,sha256=ffSLyuFlMYRDrub1GYeMwiQlxBSPi9-Xii_VUd5yz04,6245
5
- airbyte_cdk/cli/airbyte_cdk/_image.py,sha256=Uc7gpWHr9JPX2qLXP7jn4Va5W4Ruc8E2m9M2Yv8jwRA,5490
4
+ airbyte_cdk/cli/airbyte_cdk/_connector.py,sha256=3AaKtp7QIuJcVrk7eHB9JokDyw2mTSBNiHCdpreL5no,6500
5
+ airbyte_cdk/cli/airbyte_cdk/_image.py,sha256=1Yu5CL5Eo07eY0OPBSgv1NfKoyNXualRr14KeGn0F0E,5773
6
6
  airbyte_cdk/cli/airbyte_cdk/_manifest.py,sha256=aFdeeWgek7oXR3YfZPxk7kBZ64Blmsr0dAXN6BVGiIA,482
7
7
  airbyte_cdk/cli/airbyte_cdk/_secrets.py,sha256=zkO9bO5pfOA-EJb0HRdEdSiybMFkyiqiQ6MWXldAg0s,17630
8
8
  airbyte_cdk/cli/airbyte_cdk/_version.py,sha256=ohZNIktLFk91sdzqFW5idaNrZAPX2dIRnz---_fcKOE,352
@@ -166,9 +166,9 @@ airbyte_cdk/sources/declarative/requesters/error_handlers/default_http_response_
166
166
  airbyte_cdk/sources/declarative/requesters/error_handlers/error_handler.py,sha256=Tan66odx8VHzfdyyXMQkXz2pJYksllGqvxmpoajgcK4,669
167
167
  airbyte_cdk/sources/declarative/requesters/error_handlers/http_response_filter.py,sha256=E-fQbt4ShfxZVoqfnmOx69C6FUPWZz8BIqI3DN9Kcjs,7935
168
168
  airbyte_cdk/sources/declarative/requesters/http_job_repository.py,sha256=pVzIDdfGs1eAZo9F6zeFYKlEmEqanhNvZLKFCHkdmNo,14348
169
- airbyte_cdk/sources/declarative/requesters/http_requester.py,sha256=1qUqNxJ6I_4uSkW4KYXEtygVioURIEmiaDU8GMl_Jcs,18833
169
+ airbyte_cdk/sources/declarative/requesters/http_requester.py,sha256=cktdjnOu-o98smdCdrWC361iWNamPTZ-csT32OFh00c,18920
170
170
  airbyte_cdk/sources/declarative/requesters/paginators/__init__.py,sha256=uArbKs9JKNCt7t9tZoeWwjDpyI1HoPp29FNW0JzvaEM,644
171
- airbyte_cdk/sources/declarative/requesters/paginators/default_paginator.py,sha256=SB-Af3CRb4mJwhm4EKNxzl_PK2w5QS4tqrSNNMO2IV4,12760
171
+ airbyte_cdk/sources/declarative/requesters/paginators/default_paginator.py,sha256=kH_gwgULvEr8na-sST93gpr5pgqk8oT2aZNPebyMqlc,12293
172
172
  airbyte_cdk/sources/declarative/requesters/paginators/no_pagination.py,sha256=b1-zKxYOUMHn7ahdWpzKEzfG4A7s_WQWy-vzRqZWzME,2152
173
173
  airbyte_cdk/sources/declarative/requesters/paginators/paginator.py,sha256=TzJF1Q-CFlsHF9lMSfmnGCxRYm9_UQCmBcHYQpc7F30,2376
174
174
  airbyte_cdk/sources/declarative/requesters/paginators/strategies/__init__.py,sha256=2gly8fuZpDNwtu1Qg6oE2jBLGqQRdzSLJdnpk_iDV6I,767
@@ -389,14 +389,14 @@ airbyte_cdk/test/mock_http/response.py,sha256=s4-cQQqTtmeej0pQDWqmG0vUWpHS-93lIW
389
389
  airbyte_cdk/test/mock_http/response_builder.py,sha256=F-v7ebftqGj7YVIMLKdodmU9U8Dq8aIyllWGo2NGwHc,8331
390
390
  airbyte_cdk/test/models/__init__.py,sha256=5f5oFcuUA3dyNTfvvTWav2pTD8WX4nznObKgMTmvdus,290
391
391
  airbyte_cdk/test/models/outcome.py,sha256=niSX6gkP4P-_kQUF1jkbBXq72FC3Rtkvtdl0gJsUyho,2263
392
- airbyte_cdk/test/models/scenario.py,sha256=sXzqDRv1SOS16PR9nF_6Yy6e0AiD8YFqHF8dREQitpo,6233
392
+ airbyte_cdk/test/models/scenario.py,sha256=M6vq4btxUI6ZiSQNNoNFOgUsZNDFdoieGOTe-AVHstc,6435
393
393
  airbyte_cdk/test/standard_tests/__init__.py,sha256=TGCSc9bqfiEhdfyz7SVqwBog2CsCY1unCXocSXswtV0,1369
394
394
  airbyte_cdk/test/standard_tests/_job_runner.py,sha256=PF3ffgaB8ZQX5bdNLL37wq7S9P3VJhGBXsNIIv6JSb4,5639
395
395
  airbyte_cdk/test/standard_tests/connector_base.py,sha256=AhM856o5cFYN6bKYvyTdNLP7NFKYWXR_-U6kXqDAHdQ,4994
396
396
  airbyte_cdk/test/standard_tests/declarative_sources.py,sha256=4lmXKVJEhYeZAYaaXODwkn-DoJt_V--Thbea0kzOqdc,3502
397
397
  airbyte_cdk/test/standard_tests/destination_base.py,sha256=MARZip2mdo_PzGvzf2VBTAfrP4tbjrJYgeJUApnAArA,731
398
398
  airbyte_cdk/test/standard_tests/docker_base.py,sha256=zWrtv4aKKLXc4cLuAp0c2BpLSGu8-PY94Ytf_nEfx9M,16016
399
- airbyte_cdk/test/standard_tests/pytest_hooks.py,sha256=qUrRN36PVHdaGQXLnb3y4CzQhkktq7qnRQppnOfSQh4,5773
399
+ airbyte_cdk/test/standard_tests/pytest_hooks.py,sha256=GSlVx31K0kvk7VX0k4B5Stywba8RU67HsLQ5B8ij5Sw,6263
400
400
  airbyte_cdk/test/standard_tests/source_base.py,sha256=-V8vOJhPndIYUOhBkM85mHSee4jCN0JvGTrF_AaSTaQ,7010
401
401
  airbyte_cdk/test/standard_tests/util.py,sha256=ncXVo6f_gJS2z_Pn6d_OhkuSVRiTy1D5SsPpRYAYWm4,3267
402
402
  airbyte_cdk/test/state_builder.py,sha256=kLPql9lNzUJaBg5YYRLJlY_Hy5JLHJDVyKPMZMoYM44,946
@@ -424,9 +424,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
424
424
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
425
425
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
426
426
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
427
- airbyte_cdk-6.60.8.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
428
- airbyte_cdk-6.60.8.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
429
- airbyte_cdk-6.60.8.dist-info/METADATA,sha256=UrkSSRZw06_JZ08-hrGyc2-PqOdLB83tiqFFFBgCRnw,6477
430
- airbyte_cdk-6.60.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
431
- airbyte_cdk-6.60.8.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
432
- airbyte_cdk-6.60.8.dist-info/RECORD,,
427
+ airbyte_cdk-6.60.10.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
428
+ airbyte_cdk-6.60.10.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
429
+ airbyte_cdk-6.60.10.dist-info/METADATA,sha256=KXyH_12QEMpUTXIqXvPXvEFanE8Km-uA1aAK0Hax_o0,6478
430
+ airbyte_cdk-6.60.10.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
431
+ airbyte_cdk-6.60.10.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
432
+ airbyte_cdk-6.60.10.dist-info/RECORD,,