airbyte-cdk 6.37.3__py3-none-any.whl → 6.38.0__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.
@@ -1,7 +1,3 @@
1
1
  #
2
2
  # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
3
  #
4
-
5
- from airbyte_cdk.sources.declarative.datetime.min_max_datetime import MinMaxDatetime
6
-
7
- __all__ = ["MinMaxDatetime"]
@@ -29,6 +29,8 @@ class DatetimeParser:
29
29
  return datetime.datetime.fromtimestamp(int(date), tz=datetime.timezone.utc)
30
30
  elif format == "%s_as_float":
31
31
  return datetime.datetime.fromtimestamp(float(date), tz=datetime.timezone.utc)
32
+ elif format == "%epoch_microseconds":
33
+ return self._UNIX_EPOCH + datetime.timedelta(microseconds=int(date))
32
34
  elif format == "%ms":
33
35
  return self._UNIX_EPOCH + datetime.timedelta(milliseconds=int(date))
34
36
  elif "%_ms" in format:
@@ -46,6 +48,8 @@ class DatetimeParser:
46
48
  return str(int(dt.timestamp()))
47
49
  if format == "%s_as_float":
48
50
  return str(float(dt.timestamp()))
51
+ if format == "%epoch_microseconds":
52
+ return str(int(dt.timestamp() * 1_000_000))
49
53
  if format == "%ms":
50
54
  # timstamp() returns a float representing the number of seconds since the unix epoch
51
55
  return str(int(dt.timestamp() * 1000))
@@ -12,6 +12,8 @@ import pytz
12
12
  from dateutil import parser
13
13
  from isodate import parse_duration
14
14
 
15
+ from airbyte_cdk.sources.declarative.datetime.datetime_parser import DatetimeParser
16
+
15
17
  """
16
18
  This file contains macros that can be evaluated by a `JinjaInterpolation` object
17
19
  """
@@ -171,11 +173,7 @@ def format_datetime(
171
173
  dt_datetime = (
172
174
  datetime.datetime.strptime(dt, input_format) if input_format else str_to_datetime(dt)
173
175
  )
174
- if format == "%s":
175
- return str(int(dt_datetime.timestamp()))
176
- elif format == "%ms":
177
- return str(int(dt_datetime.timestamp() * 1_000_000))
178
- return dt_datetime.strftime(format)
176
+ return DatetimeParser().format(dt=dt_datetime, format=format)
179
177
 
180
178
 
181
179
  _macros_list = [
@@ -56,7 +56,7 @@ from airbyte_cdk.sources.declarative.auth.token_provider import (
56
56
  )
57
57
  from airbyte_cdk.sources.declarative.checks import CheckDynamicStream, CheckStream
58
58
  from airbyte_cdk.sources.declarative.concurrency_level import ConcurrencyLevel
59
- from airbyte_cdk.sources.declarative.datetime import MinMaxDatetime
59
+ from airbyte_cdk.sources.declarative.datetime.min_max_datetime import MinMaxDatetime
60
60
  from airbyte_cdk.sources.declarative.declarative_stream import DeclarativeStream
61
61
  from airbyte_cdk.sources.declarative.decoders import (
62
62
  Decoder,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.37.3
3
+ Version: 6.38.0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -68,8 +68,8 @@ airbyte_cdk/sources/declarative/checks/connection_checker.py,sha256=MBRJo6WJlZQH
68
68
  airbyte_cdk/sources/declarative/concurrency_level/__init__.py,sha256=5XUqrmlstYlMM0j6crktlKQwALek0uiz2D3WdM46MyA,191
69
69
  airbyte_cdk/sources/declarative/concurrency_level/concurrency_level.py,sha256=YIwCTCpOr_QSNW4ltQK0yUGWInI8PKNY216HOOegYLk,2101
70
70
  airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=rAp-sgld4n8Tmybz-51m7VcYXqKwzKDpCJVr1elmkRc,26824
71
- airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=l9LG7Qm6e5r_qgqfVKnx3mXYtg1I9MmMjomVIPfU4XA,177
72
- airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=0qs4hhmh_XOy2B4MHCn2qVMM79C6MizIBqnvpZj1aSE,2923
71
+ airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
72
+ airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=_zGNGq31RNy_0QBLt_EcTvgPyhj7urPdx6oA3M5-r3o,3150
73
73
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
74
74
  airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=n8hJVquDj00_VS_I0B2QgwYNcNcfsVZdkajAKArcOHU,147487
75
75
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=nF7wBqFd3AQmEKAm4CnIo29CJoQL562cJGSCeL8U8bA,1531
@@ -107,7 +107,7 @@ airbyte_cdk/sources/declarative/interpolation/interpolated_nested_mapping.py,sha
107
107
  airbyte_cdk/sources/declarative/interpolation/interpolated_string.py,sha256=CQkHqGlfa87G6VYMtBAQWin7ECKpfMdrDcg0JO5_rhc,3212
108
108
  airbyte_cdk/sources/declarative/interpolation/interpolation.py,sha256=9IoeuWam3L6GyN10L6U8xNWXmkt9cnahSDNkez1OmFY,982
109
109
  airbyte_cdk/sources/declarative/interpolation/jinja.py,sha256=UQeuS4Vpyp4hlOn-R3tRyeBX0e9IoV6jQ6gH-Jz8lY0,7182
110
- airbyte_cdk/sources/declarative/interpolation/macros.py,sha256=uuXBZUWDWM-sPcUKjNSPRN657QhNQCx_hnhTuJj2zOA,5129
110
+ airbyte_cdk/sources/declarative/interpolation/macros.py,sha256=HQKHKnjE17zKoPn27ZpTpugRZZQSaof4GVzUUZaV2eE,5081
111
111
  airbyte_cdk/sources/declarative/manifest_declarative_source.py,sha256=TN6GCgLXaWDONTaJwQ3A5ELqC-sxwKz-UYSraJYB-dI,17078
112
112
  airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
113
113
  airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=iemy3fKLczcU0-Aor7tx5jcT6DRedKMqyK7kCOp01hg,3924
@@ -119,7 +119,7 @@ airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=jDw_TttD3
119
119
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=Rir9_z3Kcd5Es0-LChrzk-0qubAsiK_RSEnLmK2OXm8,553
120
120
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=CXwTfD3wSQq3okcqwigpprbHhSURUokh4GK2OmOyKC8,9132
121
121
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=IWUOdF03o-aQn0Occo1BJCxU0Pz-QILk5L67nzw2thw,6803
122
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=Mx0KJGbqIZeUWduKy-UvpVH-DRm0pzXDcz203r69oNY,140619
122
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=Tq-T4iFS8Dh8cGEEN0KrowF_QqPxiXvcs-Djct1qlpA,140636
123
123
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=HJ-Syp3p7RpyR_OK0X_a2kSyISfu3W-PKrRI16iY0a8,957
124
124
  airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
125
125
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
@@ -356,9 +356,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
356
356
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
357
357
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
358
358
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
359
- airbyte_cdk-6.37.3.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
360
- airbyte_cdk-6.37.3.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
361
- airbyte_cdk-6.37.3.dist-info/METADATA,sha256=v9onCUpUoKyUWt8gmEky4HYNO1I348K2K_mBX9z4kUM,6013
362
- airbyte_cdk-6.37.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
363
- airbyte_cdk-6.37.3.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
364
- airbyte_cdk-6.37.3.dist-info/RECORD,,
359
+ airbyte_cdk-6.38.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
360
+ airbyte_cdk-6.38.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
361
+ airbyte_cdk-6.38.0.dist-info/METADATA,sha256=j7joeZ29JLG64WAacW_etS4UoRK2zb462sx04SsyFNU,6013
362
+ airbyte_cdk-6.38.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
363
+ airbyte_cdk-6.38.0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
364
+ airbyte_cdk-6.38.0.dist-info/RECORD,,