airbyte-cdk 6.53.1__py3-none-any.whl → 6.54.1__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.
@@ -20,7 +20,8 @@ This directory contains the logic and registry for manifest migrations in the Ai
20
20
 
21
21
  3. **Register the Migration:**
22
22
  - Open `migrations/registry.yaml`.
23
- - Add an entry under the appropriate version, or create a new version section if needed.
23
+ - Add an entry under the appropriate version, or create a new version section if needed.
24
+ - Version can be: "*", "==6.48.3", "~=1.2", ">=1.0.0,<2.0.0", "6.48.3"
24
25
  - Each migration entry should include:
25
26
  - `name`: The filename (without `.py`)
26
27
  - `order`: The order in which this migration should be applied for the version
@@ -5,9 +5,11 @@
5
5
 
6
6
  import copy
7
7
  import logging
8
+ import re
8
9
  from datetime import datetime, timezone
9
- from typing import Type
10
+ from typing import Tuple, Type
10
11
 
12
+ from packaging.specifiers import SpecifierSet
11
13
  from packaging.version import Version
12
14
 
13
15
  from airbyte_cdk.manifest_migrations.exceptions import (
@@ -25,7 +27,7 @@ from airbyte_cdk.manifest_migrations.migrations_registry import (
25
27
  METADATA_TAG = "metadata"
26
28
  MANIFEST_VERSION_TAG = "version"
27
29
  APPLIED_MIGRATIONS_TAG = "applied_migrations"
28
-
30
+ WILDCARD_VERSION_PATTERN = ".*"
29
31
  LOGGER = logging.getLogger("airbyte.cdk.manifest_migrations")
30
32
 
31
33
 
@@ -77,11 +79,14 @@ class ManifestMigrationHandler:
77
79
  """
78
80
  try:
79
81
  migration_instance = migration_class()
80
- if self._version_is_valid_for_migration(manifest_version, migration_version):
82
+ can_apply_migration, should_bump_version = self._version_is_valid_for_migration(
83
+ manifest_version, migration_version
84
+ )
85
+ if can_apply_migration:
81
86
  migration_instance._process_manifest(self._migrated_manifest)
82
87
  if migration_instance.is_migrated:
83
- # set the updated manifest version, after migration has been applied
84
- self._set_manifest_version(migration_version)
88
+ if should_bump_version:
89
+ self._set_manifest_version(migration_version)
85
90
  self._set_migration_trace(migration_class, manifest_version, migration_version)
86
91
  else:
87
92
  LOGGER.info(
@@ -112,18 +117,30 @@ class ManifestMigrationHandler:
112
117
  self,
113
118
  manifest_version: str,
114
119
  migration_version: str,
115
- ) -> bool:
120
+ ) -> Tuple[bool, bool]:
121
+ """
122
+ Decide whether *manifest_version* satisfies the *migration_version* rule.
123
+
124
+ Rules
125
+ -----
126
+ 1. ``"*"``
127
+ – Wildcard: anything matches.
128
+ 2. String starts with a PEP 440 operator (``==``, ``!=``, ``<=``, ``>=``,
129
+ ``<``, ``>``, ``~=``, etc.)
130
+ – Treat *migration_version* as a SpecifierSet and test the manifest
131
+ version against it.
132
+ 3. Plain version
133
+ – Interpret both strings as concrete versions and return
134
+ ``manifest_version <= migration_version``.
116
135
  """
117
- Checks if the given manifest version is less than or equal to the specified migration version.
136
+ if re.match(WILDCARD_VERSION_PATTERN, migration_version):
137
+ return True, False
118
138
 
119
- Args:
120
- manifest_version (str): The version of the manifest to check.
121
- migration_version (str): The migration version to compare against.
139
+ if migration_version.startswith(("=", "!", ">", "<", "~")):
140
+ spec = SpecifierSet(migration_version)
141
+ return spec.contains(Version(manifest_version)), False
122
142
 
123
- Returns:
124
- bool: True if the manifest version is less than or equal to the migration version, False otherwise.
125
- """
126
- return Version(manifest_version) <= Version(migration_version)
143
+ return Version(manifest_version) <= Version(migration_version), True
127
144
 
128
145
  def _set_manifest_version(self, version: str) -> None:
129
146
  """
@@ -2,3 +2,18 @@
2
2
  # Copyright (c) 2025 Airbyte, Inc., all rights reserved.
3
3
  #
4
4
 
5
+ from airbyte_cdk.manifest_migrations.migrations.http_requester_path_to_url import (
6
+ HttpRequesterPathToUrl,
7
+ )
8
+ from airbyte_cdk.manifest_migrations.migrations.http_requester_request_body_json_data_to_request_body import (
9
+ HttpRequesterRequestBodyJsonDataToRequestBody,
10
+ )
11
+ from airbyte_cdk.manifest_migrations.migrations.http_requester_url_base_to_url import (
12
+ HttpRequesterUrlBaseToUrl,
13
+ )
14
+
15
+ __all__ = [
16
+ "HttpRequesterPathToUrl",
17
+ "HttpRequesterRequestBodyJsonDataToRequestBody",
18
+ "HttpRequesterUrlBaseToUrl",
19
+ ]
@@ -3,7 +3,7 @@
3
3
  #
4
4
 
5
5
  manifest_migrations:
6
- - version: 6.48.3
6
+ - version: "*"
7
7
  migrations:
8
8
  - name: http_requester_url_base_to_url
9
9
  order: 1
@@ -3630,6 +3630,9 @@ definitions:
3630
3630
  delimiter:
3631
3631
  type: string
3632
3632
  default: ","
3633
+ set_empty_cell_to_none:
3634
+ type: boolean
3635
+ default: false
3633
3636
  AsyncJobStatusMap:
3634
3637
  description: Matches the api job status to Async Job Status.
3635
3638
  type: object
@@ -103,6 +103,7 @@ class CsvParser(Parser):
103
103
  # TODO: migrate implementation to re-use file-base classes
104
104
  encoding: Optional[str] = "utf-8"
105
105
  delimiter: Optional[str] = ","
106
+ set_empty_cell_to_none: Optional[bool] = False
106
107
 
107
108
  def _get_delimiter(self) -> Optional[str]:
108
109
  """
@@ -121,6 +122,8 @@ class CsvParser(Parser):
121
122
  text_data = TextIOWrapper(data, encoding=self.encoding) # type: ignore
122
123
  reader = csv.DictReader(text_data, delimiter=self._get_delimiter() or ",")
123
124
  for row in reader:
125
+ if self.set_empty_cell_to_none:
126
+ row = {k: (None if v == "" else v) for k, v in row.items()}
124
127
  yield row
125
128
 
126
129
 
@@ -1383,6 +1383,7 @@ class CsvDecoder(BaseModel):
1383
1383
  type: Literal["CsvDecoder"]
1384
1384
  encoding: Optional[str] = "utf-8"
1385
1385
  delimiter: Optional[str] = ","
1386
+ set_empty_cell_to_none: Optional[bool] = False
1386
1387
 
1387
1388
 
1388
1389
  class AsyncJobStatusMap(BaseModel):
@@ -2648,7 +2648,11 @@ class ModelToComponentFactory:
2648
2648
  elif isinstance(model, JsonlDecoderModel):
2649
2649
  return JsonLineParser()
2650
2650
  elif isinstance(model, CsvDecoderModel):
2651
- return CsvParser(encoding=model.encoding, delimiter=model.delimiter)
2651
+ return CsvParser(
2652
+ encoding=model.encoding,
2653
+ delimiter=model.delimiter,
2654
+ set_empty_cell_to_none=model.set_empty_cell_to_none,
2655
+ )
2652
2656
  elif isinstance(model, GzipDecoderModel):
2653
2657
  return GzipParser(
2654
2658
  inner_parser=ModelToComponentFactory._get_parser(model.decoder, config)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.53.1
3
+ Version: 6.54.1
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -36,16 +36,16 @@ airbyte_cdk/destinations/vector_db_based/writer.py,sha256=nZ00xPiohElJmYktEZZIhr
36
36
  airbyte_cdk/entrypoint.py,sha256=R2kAsAnCAI7eZCctQpMCImLhFFwo7PniJVA0e7RhJVI,19774
37
37
  airbyte_cdk/exception_handler.py,sha256=D_doVl3Dt60ASXlJsfviOCswxGyKF2q0RL6rif3fNks,2013
38
38
  airbyte_cdk/logger.py,sha256=1cURbvawbunCAV178q-XhTHcbAQZTSf07WhU7U9AXWU,3744
39
- airbyte_cdk/manifest_migrations/README.md,sha256=PvnbrW1gyzhlkeucd0YAOXcXVxi0xBUUynzs4DMqjDo,2942
39
+ airbyte_cdk/manifest_migrations/README.md,sha256=4v7BSW3Lkx7HdsKPP3IevfvdFbDCn5fekl-GxOGrWK0,3020
40
40
  airbyte_cdk/manifest_migrations/__init__.py,sha256=0eq9ic_6GGXMwzE31eAOSA7PLtBauMfgM9XshjYHF84,61
41
41
  airbyte_cdk/manifest_migrations/exceptions.py,sha256=mmMZaCVEkYSGykVL5jKA0xsDWWkybRdQwnh9pGb7VG0,300
42
42
  airbyte_cdk/manifest_migrations/manifest_migration.py,sha256=4ohLfbj2PeuPSgCMVbCArb0d-YdaZIllX4ieXQNiRRw,4420
43
- airbyte_cdk/manifest_migrations/migration_handler.py,sha256=CF8in-Eb45TGzFBxEJrXSzqVr8Lgv0vqvZlbuz1rbQk,6096
44
- airbyte_cdk/manifest_migrations/migrations/__init__.py,sha256=SJ7imfOgCRYOVaFkW2bVEnSUxbYPlkryWwYT2semsF0,62
43
+ airbyte_cdk/manifest_migrations/migration_handler.py,sha256=xVTvGoSsTpSLd2mOXHL_D0MxQMGuumiAqW-YWJYfQdY,6716
44
+ airbyte_cdk/manifest_migrations/migrations/__init__.py,sha256=HRN7fMMbTuM9W1vmycmw9GrXAHH2DYOaYKl3k3p98tw,592
45
45
  airbyte_cdk/manifest_migrations/migrations/http_requester_path_to_url.py,sha256=IIn2SjRh1v2yaSBFUCDyBHpX6mBhlckhvbsSg55mREI,2153
46
46
  airbyte_cdk/manifest_migrations/migrations/http_requester_request_body_json_data_to_request_body.py,sha256=4nX0oUcFytjpCFnz-oEf4JpeROP7_NBOEX9gCKFoBgg,2726
47
47
  airbyte_cdk/manifest_migrations/migrations/http_requester_url_base_to_url.py,sha256=EX1MVYVpoWypA28qoH48wA0SYZjGdlR8bcSixTDzfgo,1346
48
- airbyte_cdk/manifest_migrations/migrations/registry.yaml,sha256=K5KBQ2C1T_dWExEJFuEAe1VO_QqOijOCh90rnUOCEyc,960
48
+ airbyte_cdk/manifest_migrations/migrations/registry.yaml,sha256=SITcsFFf0avFYZzEb4X2K4W_lXAHrXry9qoEhEVFQvg,957
49
49
  airbyte_cdk/manifest_migrations/migrations_registry.py,sha256=zly2fwaOxDukqC7eowzrDlvhA2v71FjW74kDzvRXhSY,2619
50
50
  airbyte_cdk/models/__init__.py,sha256=Et9wJWs5VOWynGbb-3aJRhsdAHAiLkNNLxdwqJAuqkw,2114
51
51
  airbyte_cdk/models/airbyte_protocol.py,sha256=oZdKsZ7yPjUt9hvxdWNpxCtgjSV2RWhf4R9Np03sqyY,3613
@@ -89,11 +89,11 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=OKor1mDD
89
89
  airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
90
90
  airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=_zGNGq31RNy_0QBLt_EcTvgPyhj7urPdx6oA3M5-r3o,3150
91
91
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
92
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=BQ0JKz4K8BKCpKp3C2IumJj2y2nv29lheeJUxPX6gXU,177389
92
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=sFHlde6dHSjs2q7lRF6Tv2_9tR2bsVzrjxAIQqi0lNg,177464
93
93
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=qmyMnnet92eGc3C22yBtpvD5UZjqdhsAafP_zxI5wp8,1814
94
94
  airbyte_cdk/sources/declarative/declarative_stream.py,sha256=dCRlddBUSaJmBNBz1pSO1r2rTw8AP5d2_vlmIeGs2gg,10767
95
95
  airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=JHb_0d3SE6kNY10mxA5YBEKPeSbsWYjByq1gUQxepoE,953
96
- airbyte_cdk/sources/declarative/decoders/composite_raw_decoder.py,sha256=Jd7URkDQBoHSDQHQuYUqzeex1HYfLRtGcY_-dVW33pA,7884
96
+ airbyte_cdk/sources/declarative/decoders/composite_raw_decoder.py,sha256=71_84brT5nSQs-h2QnFfcz66ecgVnXsvTo1AHI-wEtc,8055
97
97
  airbyte_cdk/sources/declarative/decoders/decoder.py,sha256=1PeKwuMK8x9dsA2zqUjSVinEWVSEgYcUS6npiW3aC2c,855
98
98
  airbyte_cdk/sources/declarative/decoders/decoder_parser.py,sha256=e0be6kfzvbnhmcou-AuloFTSoLxiV9sG9YaglWo5mto,714
99
99
  airbyte_cdk/sources/declarative/decoders/json_decoder.py,sha256=BdWpXXPhEGf_zknggJmhojLosmxuw51RBVTS0jvdCPc,2080
@@ -133,14 +133,14 @@ airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migrati
133
133
  airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
134
134
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
135
135
  airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py,sha256=Imnj3yef0aqRdLfaUxkIYISUb8YkiPrRH_wBd-x8HjM,5999
136
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=XVfBPgNBEEkv8u6Bj1JRiXsQWa_QoipPHFxND_YsxDY,125766
136
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=36uZnvm9la9gEr4FqkjxA_l1-3TiApCWLfPApP9vBcw,125817
137
137
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
138
138
  airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=nlVvHC511NUyDEEIRBkoeDTAvLqKNp-hRy8D19z8tdk,5941
139
139
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=wnRUP0Xeru9Rbu5OexXSDN9QWDo8YU4tT9M2LDVOgGA,802
140
140
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=2UdpCz3yi7ISZTyqkQXSSy3dMxeyOWqV7OlAS5b9GVg,11568
141
141
  airbyte_cdk/sources/declarative/parsers/manifest_normalizer.py,sha256=laBy7ebjA-PiNwc-50U4FHvMqS_mmHvnabxgFs4CjGw,17069
142
142
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=pJmg78vqE5VfUrF_KJnWjucQ4k9IWFULeAxHCowrHXE,6806
143
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=KdOz6g57PIyXlUeVi4lYJsm2LTUxbMMpgg1wS4KUjEo,174974
143
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=B7HVR8EtcDvhWgB3MH_rHGh_tAlLHY-ZUqXh0lWMrZc,175090
144
144
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=TBC9AkGaUqHm2IKHMPN6punBIcY5tWGULowcLoAVkfw,1109
145
145
  airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
146
146
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
@@ -420,9 +420,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
420
420
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
421
421
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
422
422
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
423
- airbyte_cdk-6.53.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
424
- airbyte_cdk-6.53.1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
425
- airbyte_cdk-6.53.1.dist-info/METADATA,sha256=PXRi9Y27Ppw4cM1C0bmAeUW0XV4w9JhF3yBS77PzhlQ,6343
426
- airbyte_cdk-6.53.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
427
- airbyte_cdk-6.53.1.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
428
- airbyte_cdk-6.53.1.dist-info/RECORD,,
423
+ airbyte_cdk-6.54.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
424
+ airbyte_cdk-6.54.1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
425
+ airbyte_cdk-6.54.1.dist-info/METADATA,sha256=2oOgJRmQYFL6bH7n3HKMmQXsFGygqJkOfWxkV4Gdi2Q,6343
426
+ airbyte_cdk-6.54.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
427
+ airbyte_cdk-6.54.1.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
428
+ airbyte_cdk-6.54.1.dist-info/RECORD,,