airbyte-cdk 6.60.0.post17.dev16484729071__py3-none-any.whl → 6.60.0.post18.dev16485197212__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.
- airbyte_cdk/utils/datetime_helpers.py +14 -5
- {airbyte_cdk-6.60.0.post17.dev16484729071.dist-info → airbyte_cdk-6.60.0.post18.dev16485197212.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.60.0.post17.dev16484729071.dist-info → airbyte_cdk-6.60.0.post18.dev16485197212.dist-info}/RECORD +7 -7
- {airbyte_cdk-6.60.0.post17.dev16484729071.dist-info → airbyte_cdk-6.60.0.post18.dev16485197212.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.60.0.post17.dev16484729071.dist-info → airbyte_cdk-6.60.0.post18.dev16485197212.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.60.0.post17.dev16484729071.dist-info → airbyte_cdk-6.60.0.post18.dev16485197212.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.60.0.post17.dev16484729071.dist-info → airbyte_cdk-6.60.0.post18.dev16485197212.dist-info}/entry_points.txt +0 -0
@@ -86,7 +86,6 @@ from typing import Any, Optional, Union, overload
|
|
86
86
|
|
87
87
|
from dateutil import parser
|
88
88
|
from typing_extensions import Never
|
89
|
-
from whenever import Instant, LocalDateTime, ZonedDateTime
|
90
89
|
|
91
90
|
|
92
91
|
class AirbyteDateTime(datetime):
|
@@ -138,6 +137,18 @@ class AirbyteDateTime(datetime):
|
|
138
137
|
dt.tzinfo or timezone.utc,
|
139
138
|
)
|
140
139
|
|
140
|
+
@classmethod
|
141
|
+
def from_timestamp(cls, timestamp: float) -> "AirbyteDateTime":
|
142
|
+
"""Creates an AirbyteDateTime from a Unix timestamp in seconds.
|
143
|
+
|
144
|
+
Args:
|
145
|
+
timestamp: A Unix timestamp in seconds (float).
|
146
|
+
|
147
|
+
Returns:
|
148
|
+
AirbyteDateTime: A new timezone-aware datetime instance (UTC).
|
149
|
+
"""
|
150
|
+
return AirbyteDateTime.from_datetime(datetime.fromtimestamp(timestamp, tz=timezone.utc))
|
151
|
+
|
141
152
|
def to_datetime(self) -> datetime:
|
142
153
|
"""Converts this AirbyteDateTime to a standard datetime object.
|
143
154
|
|
@@ -400,8 +411,7 @@ def ab_datetime_parse(dt_str: str | int) -> AirbyteDateTime:
|
|
400
411
|
raise ValueError("Timestamp cannot be negative")
|
401
412
|
if len(str(abs(timestamp))) > 10:
|
402
413
|
raise ValueError("Timestamp value too large")
|
403
|
-
|
404
|
-
return AirbyteDateTime.from_datetime(instant.py_datetime())
|
414
|
+
return AirbyteDateTime.from_timestamp(timestamp)
|
405
415
|
|
406
416
|
if not isinstance(dt_str, str):
|
407
417
|
raise ValueError(
|
@@ -414,8 +424,7 @@ def ab_datetime_parse(dt_str: str | int) -> AirbyteDateTime:
|
|
414
424
|
year, month, day = map(int, dt_str.split("-"))
|
415
425
|
if not (1 <= month <= 12 and 1 <= day <= 31):
|
416
426
|
raise ValueError(f"Invalid date format: {dt_str}")
|
417
|
-
|
418
|
-
return AirbyteDateTime.from_datetime(instant.py_datetime())
|
427
|
+
return AirbyteDateTime(year, month, day, 0, 0, 0)
|
419
428
|
except (ValueError, TypeError):
|
420
429
|
raise ValueError(f"Invalid date format: {dt_str}")
|
421
430
|
|
@@ -411,7 +411,7 @@ airbyte_cdk/utils/analytics_message.py,sha256=bi3uugQ2NjecnwTnz63iD5D1M8ZR8mXPbd
|
|
411
411
|
airbyte_cdk/utils/connector_paths.py,sha256=MXj0RBi3HpuvQTWH6-vc62BZZ3XguHMq0CVIkjhS3qs,8779
|
412
412
|
airbyte_cdk/utils/constants.py,sha256=QzCi7j5SqpI5I06uRvQ8FC73JVJi7rXaRnR3E_gro5c,108
|
413
413
|
airbyte_cdk/utils/datetime_format_inferrer.py,sha256=Ne2cpk7Tx3eZDEW2Q3O7jnNOY9g-w-AUMt3Ltvwg1tY,3989
|
414
|
-
airbyte_cdk/utils/datetime_helpers.py,sha256=
|
414
|
+
airbyte_cdk/utils/datetime_helpers.py,sha256=PwQq8LBpM9ZfTNZovUQGuk4D5JHXdrHP21afvdoo34Q,17980
|
415
415
|
airbyte_cdk/utils/docker.py,sha256=ub6xurQHw6qIhzgDO3V9sXOG1jkZyDGbOSSDjcazEHo,17989
|
416
416
|
airbyte_cdk/utils/event_timing.py,sha256=aiuFmPU80buLlNdKq4fDTEqqhEIelHPF6AalFGwY8as,2557
|
417
417
|
airbyte_cdk/utils/is_cloud_environment.py,sha256=DayV32Irh-SdnJ0MnjvstwCJ66_l5oEsd8l85rZtHoc,574
|
@@ -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.0.
|
428
|
-
airbyte_cdk-6.60.0.
|
429
|
-
airbyte_cdk-6.60.0.
|
430
|
-
airbyte_cdk-6.60.0.
|
431
|
-
airbyte_cdk-6.60.0.
|
432
|
-
airbyte_cdk-6.60.0.
|
427
|
+
airbyte_cdk-6.60.0.post18.dev16485197212.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
|
428
|
+
airbyte_cdk-6.60.0.post18.dev16485197212.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
|
429
|
+
airbyte_cdk-6.60.0.post18.dev16485197212.dist-info/METADATA,sha256=-vLPb3dsjRJz1xEk0o_jzuA6foZzyc2-LsbNHcloru0,6512
|
430
|
+
airbyte_cdk-6.60.0.post18.dev16485197212.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
431
|
+
airbyte_cdk-6.60.0.post18.dev16485197212.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
|
432
|
+
airbyte_cdk-6.60.0.post18.dev16485197212.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|