dagster-airbyte 0.25.7__py3-none-any.whl → 0.25.9__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.
Potentially problematic release.
This version of dagster-airbyte might be problematic. Click here for more details.
- dagster_airbyte/asset_defs.py +25 -38
- dagster_airbyte/managed/generated/sources.py +33 -33
- dagster_airbyte/managed/reconciliation.py +19 -30
- dagster_airbyte/managed/types.py +8 -7
- dagster_airbyte/ops.py +3 -2
- dagster_airbyte/resources.py +18 -17
- dagster_airbyte/translator.py +3 -2
- dagster_airbyte/types.py +2 -1
- dagster_airbyte/utils.py +2 -1
- dagster_airbyte/version.py +1 -1
- {dagster_airbyte-0.25.7.dist-info → dagster_airbyte-0.25.9.dist-info}/METADATA +3 -3
- dagster_airbyte-0.25.9.dist-info/RECORD +23 -0
- dagster_airbyte-0.25.7.dist-info/RECORD +0 -23
- {dagster_airbyte-0.25.7.dist-info → dagster_airbyte-0.25.9.dist-info}/LICENSE +0 -0
- {dagster_airbyte-0.25.7.dist-info → dagster_airbyte-0.25.9.dist-info}/WHEEL +0 -0
- {dagster_airbyte-0.25.7.dist-info → dagster_airbyte-0.25.9.dist-info}/entry_points.txt +0 -0
- {dagster_airbyte-0.25.7.dist-info → dagster_airbyte-0.25.9.dist-info}/top_level.txt +0 -0
dagster_airbyte/asset_defs.py
CHANGED
|
@@ -2,23 +2,10 @@ import hashlib
|
|
|
2
2
|
import inspect
|
|
3
3
|
import os
|
|
4
4
|
from abc import abstractmethod
|
|
5
|
+
from collections.abc import Iterable, Mapping, Sequence
|
|
5
6
|
from functools import partial
|
|
6
7
|
from itertools import chain
|
|
7
|
-
from typing import
|
|
8
|
-
Any,
|
|
9
|
-
Callable,
|
|
10
|
-
Dict,
|
|
11
|
-
Iterable,
|
|
12
|
-
List,
|
|
13
|
-
Mapping,
|
|
14
|
-
NamedTuple,
|
|
15
|
-
Optional,
|
|
16
|
-
Sequence,
|
|
17
|
-
Set,
|
|
18
|
-
Tuple,
|
|
19
|
-
Union,
|
|
20
|
-
cast,
|
|
21
|
-
)
|
|
8
|
+
from typing import Any, Callable, NamedTuple, Optional, Union, cast
|
|
22
9
|
|
|
23
10
|
import yaml
|
|
24
11
|
from dagster import (
|
|
@@ -75,7 +62,7 @@ def _build_airbyte_asset_defn_metadata(
|
|
|
75
62
|
destination_schema: Optional[str],
|
|
76
63
|
table_to_asset_key_fn: Callable[[str], AssetKey],
|
|
77
64
|
asset_key_prefix: Optional[Sequence[str]] = None,
|
|
78
|
-
normalization_tables: Optional[Mapping[str,
|
|
65
|
+
normalization_tables: Optional[Mapping[str, set[str]]] = None,
|
|
79
66
|
normalization_raw_table_names_by_table: Optional[Mapping[str, str]] = None,
|
|
80
67
|
upstream_assets: Optional[Iterable[AssetKey]] = None,
|
|
81
68
|
group_name: Optional[str] = None,
|
|
@@ -105,7 +92,7 @@ def _build_airbyte_asset_defn_metadata(
|
|
|
105
92
|
for table in tables
|
|
106
93
|
}
|
|
107
94
|
|
|
108
|
-
internal_deps:
|
|
95
|
+
internal_deps: dict[str, set[AssetKey]] = {}
|
|
109
96
|
|
|
110
97
|
metadata_encodable_normalization_tables = (
|
|
111
98
|
{k: list(v) for k, v in normalization_tables.items()} if normalization_tables else {}
|
|
@@ -124,7 +111,7 @@ def _build_airbyte_asset_defn_metadata(
|
|
|
124
111
|
for table in destination_tables:
|
|
125
112
|
internal_deps[table] = set(upstream_assets or [])
|
|
126
113
|
|
|
127
|
-
table_names:
|
|
114
|
+
table_names: dict[str, str] = {}
|
|
128
115
|
for table in destination_tables:
|
|
129
116
|
if destination_database and destination_schema and table:
|
|
130
117
|
# Use the destination raw table name to create the table name
|
|
@@ -195,8 +182,8 @@ def _build_airbyte_assets_from_metadata(
|
|
|
195
182
|
metadata = cast(Mapping[str, Any], assets_defn_meta.extra_metadata)
|
|
196
183
|
connection_id = cast(str, metadata["connection_id"])
|
|
197
184
|
group_name = cast(Optional[str], metadata["group_name"])
|
|
198
|
-
destination_tables = cast(
|
|
199
|
-
normalization_tables = cast(Mapping[str,
|
|
185
|
+
destination_tables = cast(list[str], metadata["destination_tables"])
|
|
186
|
+
normalization_tables = cast(Mapping[str, list[str]], metadata["normalization_tables"])
|
|
200
187
|
io_manager_key = cast(Optional[str], metadata["io_manager_key"])
|
|
201
188
|
|
|
202
189
|
@multi_asset(
|
|
@@ -265,9 +252,9 @@ def build_airbyte_assets(
|
|
|
265
252
|
destination_schema: Optional[str] = None,
|
|
266
253
|
asset_key_prefix: Optional[Sequence[str]] = None,
|
|
267
254
|
group_name: Optional[str] = None,
|
|
268
|
-
normalization_tables: Optional[Mapping[str,
|
|
255
|
+
normalization_tables: Optional[Mapping[str, set[str]]] = None,
|
|
269
256
|
deps: Optional[Iterable[Union[CoercibleToAssetKey, AssetsDefinition, SourceAsset]]] = None,
|
|
270
|
-
upstream_assets: Optional[
|
|
257
|
+
upstream_assets: Optional[set[AssetKey]] = None,
|
|
271
258
|
schema_by_table_name: Optional[Mapping[str, TableSchema]] = None,
|
|
272
259
|
freshness_policy: Optional[FreshnessPolicy] = None,
|
|
273
260
|
stream_to_asset_map: Optional[Mapping[str, str]] = None,
|
|
@@ -310,7 +297,7 @@ def build_airbyte_assets(
|
|
|
310
297
|
chain([destination_tables], normalization_tables.values() if normalization_tables else [])
|
|
311
298
|
)
|
|
312
299
|
|
|
313
|
-
table_names:
|
|
300
|
+
table_names: dict[str, str] = {}
|
|
314
301
|
for table in destination_tables:
|
|
315
302
|
if destination_database and destination_schema and table:
|
|
316
303
|
table_names[table] = ".".join([destination_database, destination_schema, table])
|
|
@@ -438,7 +425,7 @@ def _get_normalization_tables_for_schema(
|
|
|
438
425
|
For more information on Airbyte's normalization process, see:
|
|
439
426
|
https://docs.airbyte.com/understanding-airbyte/basic-normalization/#nesting
|
|
440
427
|
"""
|
|
441
|
-
out:
|
|
428
|
+
out: dict[str, AirbyteTableMetadata] = {}
|
|
442
429
|
# Object types are broken into a new table, as long as they have children
|
|
443
430
|
|
|
444
431
|
sub_schemas = _get_sub_schemas(schema)
|
|
@@ -478,7 +465,7 @@ class AirbyteConnectionMetadata(
|
|
|
478
465
|
("name", str),
|
|
479
466
|
("stream_prefix", str),
|
|
480
467
|
("has_basic_normalization", bool),
|
|
481
|
-
("stream_data",
|
|
468
|
+
("stream_data", list[Mapping[str, Any]]),
|
|
482
469
|
("destination", Mapping[str, Any]),
|
|
483
470
|
],
|
|
484
471
|
)
|
|
@@ -537,7 +524,7 @@ class AirbyteConnectionMetadata(
|
|
|
537
524
|
tables associated with each enabled stream and values representing any affiliated
|
|
538
525
|
tables created by Airbyte's normalization process, if enabled.
|
|
539
526
|
"""
|
|
540
|
-
tables:
|
|
527
|
+
tables: dict[str, AirbyteTableMetadata] = {}
|
|
541
528
|
|
|
542
529
|
enabled_streams = [
|
|
543
530
|
stream for stream in self.stream_data if stream.get("config", {}).get("selected", False)
|
|
@@ -552,7 +539,7 @@ class AirbyteConnectionMetadata(
|
|
|
552
539
|
if "json_schema" in stream["stream"]
|
|
553
540
|
else stream["stream"]["jsonSchema"]
|
|
554
541
|
)
|
|
555
|
-
normalization_tables:
|
|
542
|
+
normalization_tables: dict[str, AirbyteTableMetadata] = {}
|
|
556
543
|
schema_props = schema.get("properties", schema.get("items", {}).get("properties", {}))
|
|
557
544
|
if self.has_basic_normalization and return_normalization_tables:
|
|
558
545
|
for k, v in schema_props.items():
|
|
@@ -580,7 +567,7 @@ def _get_schema_by_table_name(
|
|
|
580
567
|
[
|
|
581
568
|
(k, v.schema)
|
|
582
569
|
for k, v in cast(
|
|
583
|
-
|
|
570
|
+
dict[str, AirbyteTableMetadata], meta.normalization_tables
|
|
584
571
|
).items()
|
|
585
572
|
]
|
|
586
573
|
for meta in stream_table_metadata.values()
|
|
@@ -631,11 +618,11 @@ class AirbyteCoreCacheableAssetsDefinition(CacheableAssetsDefinition):
|
|
|
631
618
|
super().__init__(unique_id=f"airbyte-{contents.hexdigest()}")
|
|
632
619
|
|
|
633
620
|
@abstractmethod
|
|
634
|
-
def _get_connections(self) -> Sequence[
|
|
621
|
+
def _get_connections(self) -> Sequence[tuple[str, AirbyteConnectionMetadata]]:
|
|
635
622
|
pass
|
|
636
623
|
|
|
637
624
|
def compute_cacheable_data(self) -> Sequence[AssetsDefinitionCacheableData]:
|
|
638
|
-
asset_defn_data:
|
|
625
|
+
asset_defn_data: list[AssetsDefinitionCacheableData] = []
|
|
639
626
|
for connection_id, connection in self._get_connections():
|
|
640
627
|
stream_table_metadata = connection.parse_stream_tables(
|
|
641
628
|
self._create_assets_for_normalization_tables
|
|
@@ -749,11 +736,11 @@ class AirbyteInstanceCacheableAssetsDefinition(AirbyteCoreCacheableAssetsDefinit
|
|
|
749
736
|
)
|
|
750
737
|
self._airbyte_instance: AirbyteResource = self._partially_initialized_airbyte_instance
|
|
751
738
|
|
|
752
|
-
def _get_connections(self) -> Sequence[
|
|
739
|
+
def _get_connections(self) -> Sequence[tuple[str, AirbyteConnectionMetadata]]:
|
|
753
740
|
workspace_id = self._workspace_id
|
|
754
741
|
if not workspace_id:
|
|
755
742
|
workspaces = cast(
|
|
756
|
-
|
|
743
|
+
list[dict[str, Any]],
|
|
757
744
|
check.not_none(
|
|
758
745
|
self._airbyte_instance.make_request(endpoint="/workspaces/list", data={})
|
|
759
746
|
).get("workspaces", []),
|
|
@@ -765,7 +752,7 @@ class AirbyteInstanceCacheableAssetsDefinition(AirbyteCoreCacheableAssetsDefinit
|
|
|
765
752
|
workspace_id = workspaces[0].get("workspaceId")
|
|
766
753
|
|
|
767
754
|
connections = cast(
|
|
768
|
-
|
|
755
|
+
list[dict[str, Any]],
|
|
769
756
|
check.not_none(
|
|
770
757
|
self._airbyte_instance.make_request(
|
|
771
758
|
endpoint="/connections/list", data={"workspaceId": workspace_id}
|
|
@@ -773,12 +760,12 @@ class AirbyteInstanceCacheableAssetsDefinition(AirbyteCoreCacheableAssetsDefinit
|
|
|
773
760
|
).get("connections", []),
|
|
774
761
|
)
|
|
775
762
|
|
|
776
|
-
output_connections:
|
|
763
|
+
output_connections: list[tuple[str, AirbyteConnectionMetadata]] = []
|
|
777
764
|
for connection_json in connections:
|
|
778
765
|
connection_id = cast(str, connection_json.get("connectionId"))
|
|
779
766
|
|
|
780
767
|
operations_json = cast(
|
|
781
|
-
|
|
768
|
+
dict[str, Any],
|
|
782
769
|
check.not_none(
|
|
783
770
|
self._airbyte_instance.make_request(
|
|
784
771
|
endpoint="/operations/list",
|
|
@@ -789,7 +776,7 @@ class AirbyteInstanceCacheableAssetsDefinition(AirbyteCoreCacheableAssetsDefinit
|
|
|
789
776
|
|
|
790
777
|
destination_id = cast(str, connection_json.get("destinationId"))
|
|
791
778
|
destination_json = cast(
|
|
792
|
-
|
|
779
|
+
dict[str, Any],
|
|
793
780
|
check.not_none(
|
|
794
781
|
self._airbyte_instance.make_request(
|
|
795
782
|
endpoint="/destinations/get",
|
|
@@ -851,10 +838,10 @@ class AirbyteYAMLCacheableAssetsDefinition(AirbyteCoreCacheableAssetsDefinition)
|
|
|
851
838
|
self._project_dir = project_dir
|
|
852
839
|
self._connection_directories = connection_directories
|
|
853
840
|
|
|
854
|
-
def _get_connections(self) -> Sequence[
|
|
841
|
+
def _get_connections(self) -> Sequence[tuple[str, AirbyteConnectionMetadata]]:
|
|
855
842
|
connections_dir = os.path.join(self._project_dir, "connections")
|
|
856
843
|
|
|
857
|
-
output_connections:
|
|
844
|
+
output_connections: list[tuple[str, AirbyteConnectionMetadata]] = []
|
|
858
845
|
|
|
859
846
|
connection_directories = self._connection_directories or os.listdir(connections_dir)
|
|
860
847
|
for connection_name in connection_directories:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# ruff: noqa: A001, A002
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Optional, Union
|
|
3
3
|
|
|
4
4
|
import dagster._check as check
|
|
5
5
|
from dagster._annotations import public
|
|
@@ -154,7 +154,7 @@ class LinkedinAdsSource(GeneratedAirbyteSource):
|
|
|
154
154
|
name: str,
|
|
155
155
|
credentials: Union["LinkedinAdsSource.OAuth20", "LinkedinAdsSource.AccessToken"],
|
|
156
156
|
start_date: str,
|
|
157
|
-
account_ids: Optional[
|
|
157
|
+
account_ids: Optional[list[int]] = None,
|
|
158
158
|
):
|
|
159
159
|
"""Airbyte Source for Linkedin Ads.
|
|
160
160
|
|
|
@@ -826,9 +826,9 @@ class JiraSource(GeneratedAirbyteSource):
|
|
|
826
826
|
api_token: str,
|
|
827
827
|
domain: str,
|
|
828
828
|
email: str,
|
|
829
|
-
projects: Optional[
|
|
829
|
+
projects: Optional[list[str]] = None,
|
|
830
830
|
start_date: Optional[str] = None,
|
|
831
|
-
additional_fields: Optional[
|
|
831
|
+
additional_fields: Optional[list[str]] = None,
|
|
832
832
|
expand_issue_changelog: Optional[bool] = None,
|
|
833
833
|
render_fields: Optional[bool] = None,
|
|
834
834
|
enable_experimental_streams: Optional[bool] = None,
|
|
@@ -1078,7 +1078,7 @@ class QualarooSource(GeneratedAirbyteSource):
|
|
|
1078
1078
|
token: str,
|
|
1079
1079
|
key: str,
|
|
1080
1080
|
start_date: str,
|
|
1081
|
-
survey_ids: Optional[
|
|
1081
|
+
survey_ids: Optional[list[str]] = None,
|
|
1082
1082
|
):
|
|
1083
1083
|
"""Airbyte Source for Qualaroo.
|
|
1084
1084
|
|
|
@@ -1405,7 +1405,7 @@ class OracleSource(GeneratedAirbyteSource):
|
|
|
1405
1405
|
"OracleSource.TLSEncryptedVerifyCertificate",
|
|
1406
1406
|
],
|
|
1407
1407
|
password: Optional[str] = None,
|
|
1408
|
-
schemas: Optional[
|
|
1408
|
+
schemas: Optional[list[str]] = None,
|
|
1409
1409
|
jdbc_url_params: Optional[str] = None,
|
|
1410
1410
|
):
|
|
1411
1411
|
"""Airbyte Source for Oracle.
|
|
@@ -1694,7 +1694,7 @@ class LookerSource(GeneratedAirbyteSource):
|
|
|
1694
1694
|
domain: str,
|
|
1695
1695
|
client_id: str,
|
|
1696
1696
|
client_secret: str,
|
|
1697
|
-
run_look_ids: Optional[
|
|
1697
|
+
run_look_ids: Optional[list[str]] = None,
|
|
1698
1698
|
):
|
|
1699
1699
|
"""Airbyte Source for Looker.
|
|
1700
1700
|
|
|
@@ -1786,8 +1786,8 @@ class AmazonAdsSource(GeneratedAirbyteSource):
|
|
|
1786
1786
|
report_wait_timeout: Optional[int] = None,
|
|
1787
1787
|
report_generation_max_retries: Optional[int] = None,
|
|
1788
1788
|
start_date: Optional[str] = None,
|
|
1789
|
-
profiles: Optional[
|
|
1790
|
-
state_filter: Optional[
|
|
1789
|
+
profiles: Optional[list[int]] = None,
|
|
1790
|
+
state_filter: Optional[list[str]] = None,
|
|
1791
1791
|
):
|
|
1792
1792
|
"""Airbyte Source for Amazon Ads.
|
|
1793
1793
|
|
|
@@ -2192,7 +2192,7 @@ class SearchMetricsSource(GeneratedAirbyteSource):
|
|
|
2192
2192
|
class TypeformSource(GeneratedAirbyteSource):
|
|
2193
2193
|
@public
|
|
2194
2194
|
def __init__(
|
|
2195
|
-
self, name: str, start_date: str, token: str, form_ids: Optional[
|
|
2195
|
+
self, name: str, start_date: str, token: str, form_ids: Optional[list[str]] = None
|
|
2196
2196
|
):
|
|
2197
2197
|
"""Airbyte Source for Typeform.
|
|
2198
2198
|
|
|
@@ -2355,10 +2355,10 @@ class AdjustSource(GeneratedAirbyteSource):
|
|
|
2355
2355
|
self,
|
|
2356
2356
|
name: str,
|
|
2357
2357
|
api_token: str,
|
|
2358
|
-
dimensions:
|
|
2358
|
+
dimensions: list[str],
|
|
2359
2359
|
ingest_start: str,
|
|
2360
|
-
metrics:
|
|
2361
|
-
additional_metrics: Optional[
|
|
2360
|
+
metrics: list[str],
|
|
2361
|
+
additional_metrics: Optional[list[str]] = None,
|
|
2362
2362
|
until_today: Optional[bool] = None,
|
|
2363
2363
|
):
|
|
2364
2364
|
"""Airbyte Source for Adjust.
|
|
@@ -2448,7 +2448,7 @@ class GoogleAdsSource(GeneratedAirbyteSource):
|
|
|
2448
2448
|
customer_id: str,
|
|
2449
2449
|
start_date: str,
|
|
2450
2450
|
end_date: Optional[str] = None,
|
|
2451
|
-
custom_queries: Optional[
|
|
2451
|
+
custom_queries: Optional[list[CustomGAQLQueriesEntry]] = None,
|
|
2452
2452
|
login_customer_id: Optional[str] = None,
|
|
2453
2453
|
conversion_window_days: Optional[int] = None,
|
|
2454
2454
|
):
|
|
@@ -2590,7 +2590,7 @@ class SalesforceSource(GeneratedAirbyteSource):
|
|
|
2590
2590
|
is_sandbox: Optional[bool] = None,
|
|
2591
2591
|
auth_type: Optional[str] = None,
|
|
2592
2592
|
start_date: Optional[str] = None,
|
|
2593
|
-
streams_criteria: Optional[
|
|
2593
|
+
streams_criteria: Optional[list[FilterSalesforceObjectsEntry]] = None,
|
|
2594
2594
|
):
|
|
2595
2595
|
"""Airbyte Source for Salesforce.
|
|
2596
2596
|
|
|
@@ -2836,8 +2836,8 @@ class OrbSource(GeneratedAirbyteSource):
|
|
|
2836
2836
|
api_key: str,
|
|
2837
2837
|
start_date: Optional[str] = None,
|
|
2838
2838
|
lookback_window_days: Optional[int] = None,
|
|
2839
|
-
string_event_properties_keys: Optional[
|
|
2840
|
-
numeric_event_properties_keys: Optional[
|
|
2839
|
+
string_event_properties_keys: Optional[list[str]] = None,
|
|
2840
|
+
numeric_event_properties_keys: Optional[list[str]] = None,
|
|
2841
2841
|
):
|
|
2842
2842
|
"""Airbyte Source for Orb.
|
|
2843
2843
|
|
|
@@ -3230,7 +3230,7 @@ class SlackSource(GeneratedAirbyteSource):
|
|
|
3230
3230
|
credentials: Union[
|
|
3231
3231
|
"SlackSource.DefaultOAuth20Authorization", "SlackSource.APITokenCredentials"
|
|
3232
3232
|
],
|
|
3233
|
-
channel_filter: Optional[
|
|
3233
|
+
channel_filter: Optional[list[str]] = None,
|
|
3234
3234
|
):
|
|
3235
3235
|
"""Airbyte Source for Slack.
|
|
3236
3236
|
|
|
@@ -3575,7 +3575,7 @@ class PostgresSource(GeneratedAirbyteSource):
|
|
|
3575
3575
|
"PostgresSource.SSHKeyAuthentication",
|
|
3576
3576
|
"PostgresSource.PasswordAuthentication",
|
|
3577
3577
|
],
|
|
3578
|
-
schemas: Optional[
|
|
3578
|
+
schemas: Optional[list[str]] = None,
|
|
3579
3579
|
password: Optional[str] = None,
|
|
3580
3580
|
jdbc_url_params: Optional[str] = None,
|
|
3581
3581
|
ssl: Optional[bool] = None,
|
|
@@ -3643,7 +3643,7 @@ class TrelloSource(GeneratedAirbyteSource):
|
|
|
3643
3643
|
token: str,
|
|
3644
3644
|
key: str,
|
|
3645
3645
|
start_date: str,
|
|
3646
|
-
board_ids: Optional[
|
|
3646
|
+
board_ids: Optional[list[str]] = None,
|
|
3647
3647
|
):
|
|
3648
3648
|
"""Airbyte Source for Trello.
|
|
3649
3649
|
|
|
@@ -3741,7 +3741,7 @@ class S3Source(GeneratedAirbyteSource):
|
|
|
3741
3741
|
def __init__(
|
|
3742
3742
|
self,
|
|
3743
3743
|
filetype: Optional[str] = None,
|
|
3744
|
-
columns: Optional[
|
|
3744
|
+
columns: Optional[list[str]] = None,
|
|
3745
3745
|
batch_size: Optional[int] = None,
|
|
3746
3746
|
buffer_size: Optional[int] = None,
|
|
3747
3747
|
):
|
|
@@ -4005,7 +4005,7 @@ class MssqlSource(GeneratedAirbyteSource):
|
|
|
4005
4005
|
"MssqlSource.EncryptedVerifyCertificate",
|
|
4006
4006
|
],
|
|
4007
4007
|
replication_method: Union["MssqlSource.Standard", "MssqlSource.LogicalReplicationCDC"],
|
|
4008
|
-
schemas: Optional[
|
|
4008
|
+
schemas: Optional[list[str]] = None,
|
|
4009
4009
|
password: Optional[str] = None,
|
|
4010
4010
|
jdbc_url_params: Optional[str] = None,
|
|
4011
4011
|
):
|
|
@@ -4096,7 +4096,7 @@ class RedshiftSource(GeneratedAirbyteSource):
|
|
|
4096
4096
|
database: str,
|
|
4097
4097
|
username: str,
|
|
4098
4098
|
password: str,
|
|
4099
|
-
schemas: Optional[
|
|
4099
|
+
schemas: Optional[list[str]] = None,
|
|
4100
4100
|
jdbc_url_params: Optional[str] = None,
|
|
4101
4101
|
):
|
|
4102
4102
|
"""Airbyte Source for Redshift.
|
|
@@ -4228,7 +4228,7 @@ class SentrySource(GeneratedAirbyteSource):
|
|
|
4228
4228
|
organization: str,
|
|
4229
4229
|
project: str,
|
|
4230
4230
|
hostname: Optional[str] = None,
|
|
4231
|
-
discover_fields: Optional[
|
|
4231
|
+
discover_fields: Optional[list[str]] = None,
|
|
4232
4232
|
):
|
|
4233
4233
|
"""Airbyte Source for Sentry.
|
|
4234
4234
|
|
|
@@ -4317,7 +4317,7 @@ class PythonHttpTutorialSource(GeneratedAirbyteSource):
|
|
|
4317
4317
|
|
|
4318
4318
|
class AirtableSource(GeneratedAirbyteSource):
|
|
4319
4319
|
@public
|
|
4320
|
-
def __init__(self, name: str, api_key: str, base_id: str, tables:
|
|
4320
|
+
def __init__(self, name: str, api_key: str, base_id: str, tables: list[str]):
|
|
4321
4321
|
"""Airbyte Source for Airtable.
|
|
4322
4322
|
|
|
4323
4323
|
Documentation can be found at https://docs.airbyte.com/integrations/sources/airtable
|
|
@@ -5123,7 +5123,7 @@ class NetsuiteSource(GeneratedAirbyteSource):
|
|
|
5123
5123
|
token_key: str,
|
|
5124
5124
|
token_secret: str,
|
|
5125
5125
|
start_datetime: str,
|
|
5126
|
-
object_types: Optional[
|
|
5126
|
+
object_types: Optional[list[str]] = None,
|
|
5127
5127
|
window_in_days: Optional[int] = None,
|
|
5128
5128
|
):
|
|
5129
5129
|
"""Airbyte Source for Netsuite.
|
|
@@ -5190,7 +5190,7 @@ class Dv360Source(GeneratedAirbyteSource):
|
|
|
5190
5190
|
partner_id: int,
|
|
5191
5191
|
start_date: str,
|
|
5192
5192
|
end_date: Optional[str] = None,
|
|
5193
|
-
filters: Optional[
|
|
5193
|
+
filters: Optional[list[str]] = None,
|
|
5194
5194
|
):
|
|
5195
5195
|
"""Airbyte Source for Dv 360.
|
|
5196
5196
|
|
|
@@ -5775,7 +5775,7 @@ class GoogleSearchConsoleSource(GeneratedAirbyteSource):
|
|
|
5775
5775
|
def __init__(
|
|
5776
5776
|
self,
|
|
5777
5777
|
name: str,
|
|
5778
|
-
site_urls:
|
|
5778
|
+
site_urls: list[str],
|
|
5779
5779
|
start_date: str,
|
|
5780
5780
|
authorization: Union[
|
|
5781
5781
|
"GoogleSearchConsoleSource.OAuth",
|
|
@@ -5816,9 +5816,9 @@ class FacebookMarketingSource(GeneratedAirbyteSource):
|
|
|
5816
5816
|
def __init__(
|
|
5817
5817
|
self,
|
|
5818
5818
|
name: str,
|
|
5819
|
-
fields: Optional[
|
|
5820
|
-
breakdowns: Optional[
|
|
5821
|
-
action_breakdowns: Optional[
|
|
5819
|
+
fields: Optional[list[str]] = None,
|
|
5820
|
+
breakdowns: Optional[list[str]] = None,
|
|
5821
|
+
action_breakdowns: Optional[list[str]] = None,
|
|
5822
5822
|
time_increment: Optional[int] = None,
|
|
5823
5823
|
start_date: Optional[str] = None,
|
|
5824
5824
|
end_date: Optional[str] = None,
|
|
@@ -5847,7 +5847,7 @@ class FacebookMarketingSource(GeneratedAirbyteSource):
|
|
|
5847
5847
|
end_date: Optional[str] = None,
|
|
5848
5848
|
include_deleted: Optional[bool] = None,
|
|
5849
5849
|
fetch_thumbnail_images: Optional[bool] = None,
|
|
5850
|
-
custom_insights: Optional[
|
|
5850
|
+
custom_insights: Optional[list[InsightConfig]] = None,
|
|
5851
5851
|
page_size: Optional[int] = None,
|
|
5852
5852
|
insights_lookback_window: Optional[int] = None,
|
|
5853
5853
|
max_batch_size: Optional[int] = None,
|
|
@@ -5891,7 +5891,7 @@ class FacebookMarketingSource(GeneratedAirbyteSource):
|
|
|
5891
5891
|
class SurveymonkeySource(GeneratedAirbyteSource):
|
|
5892
5892
|
@public
|
|
5893
5893
|
def __init__(
|
|
5894
|
-
self, name: str, access_token: str, start_date: str, survey_ids: Optional[
|
|
5894
|
+
self, name: str, access_token: str, start_date: str, survey_ids: Optional[list[str]] = None
|
|
5895
5895
|
):
|
|
5896
5896
|
"""Airbyte Source for Surveymonkey.
|
|
5897
5897
|
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
Callable,
|
|
4
|
-
Dict,
|
|
5
|
-
Iterable,
|
|
6
|
-
List,
|
|
7
|
-
Mapping,
|
|
8
|
-
Optional,
|
|
9
|
-
Sequence,
|
|
10
|
-
Tuple,
|
|
11
|
-
Union,
|
|
12
|
-
cast,
|
|
13
|
-
)
|
|
1
|
+
from collections.abc import Iterable, Mapping, Sequence
|
|
2
|
+
from typing import Any, Callable, Optional, Union, cast
|
|
14
3
|
|
|
15
4
|
import dagster._check as check
|
|
16
5
|
from dagster import AssetKey
|
|
@@ -169,13 +158,13 @@ def reconcile_sources(
|
|
|
169
158
|
dry_run: bool,
|
|
170
159
|
should_delete: bool,
|
|
171
160
|
ignore_secrets: bool,
|
|
172
|
-
) ->
|
|
161
|
+
) -> tuple[Mapping[str, InitializedAirbyteSource], ManagedElementCheckResult]:
|
|
173
162
|
"""Generates a diff of the configured and existing sources and reconciles them to match the
|
|
174
163
|
configured state if dry_run is False.
|
|
175
164
|
"""
|
|
176
165
|
diff = ManagedElementDiff()
|
|
177
166
|
|
|
178
|
-
initialized_sources:
|
|
167
|
+
initialized_sources: dict[str, InitializedAirbyteSource] = {}
|
|
179
168
|
for source_name in set(config_sources.keys()).union(existing_sources.keys()):
|
|
180
169
|
configured_source = config_sources.get(source_name)
|
|
181
170
|
existing_source = existing_sources.get(source_name)
|
|
@@ -223,7 +212,7 @@ def reconcile_sources(
|
|
|
223
212
|
else:
|
|
224
213
|
if not dry_run:
|
|
225
214
|
create_result = cast(
|
|
226
|
-
|
|
215
|
+
dict[str, str],
|
|
227
216
|
check.not_none(
|
|
228
217
|
res.make_request(
|
|
229
218
|
endpoint="/sources/create",
|
|
@@ -256,13 +245,13 @@ def reconcile_destinations(
|
|
|
256
245
|
dry_run: bool,
|
|
257
246
|
should_delete: bool,
|
|
258
247
|
ignore_secrets: bool,
|
|
259
|
-
) ->
|
|
248
|
+
) -> tuple[Mapping[str, InitializedAirbyteDestination], ManagedElementCheckResult]:
|
|
260
249
|
"""Generates a diff of the configured and existing destinations and reconciles them to match the
|
|
261
250
|
configured state if dry_run is False.
|
|
262
251
|
"""
|
|
263
252
|
diff = ManagedElementDiff()
|
|
264
253
|
|
|
265
|
-
initialized_destinations:
|
|
254
|
+
initialized_destinations: dict[str, InitializedAirbyteDestination] = {}
|
|
266
255
|
for destination_name in set(config_destinations.keys()).union(existing_destinations.keys()):
|
|
267
256
|
configured_destination = config_destinations.get(destination_name)
|
|
268
257
|
existing_destination = existing_destinations.get(destination_name)
|
|
@@ -311,7 +300,7 @@ def reconcile_destinations(
|
|
|
311
300
|
else:
|
|
312
301
|
if not dry_run:
|
|
313
302
|
create_result = cast(
|
|
314
|
-
|
|
303
|
+
dict[str, str],
|
|
315
304
|
check.not_none(
|
|
316
305
|
res.make_request(
|
|
317
306
|
endpoint="/destinations/create",
|
|
@@ -357,23 +346,23 @@ def reconcile_config(
|
|
|
357
346
|
workspace_id = res.get_default_workspace()
|
|
358
347
|
|
|
359
348
|
existing_sources_raw = cast(
|
|
360
|
-
|
|
349
|
+
dict[str, list[dict[str, Any]]],
|
|
361
350
|
check.not_none(
|
|
362
351
|
res.make_request(endpoint="/sources/list", data={"workspaceId": workspace_id})
|
|
363
352
|
),
|
|
364
353
|
)
|
|
365
354
|
existing_dests_raw = cast(
|
|
366
|
-
|
|
355
|
+
dict[str, list[dict[str, Any]]],
|
|
367
356
|
check.not_none(
|
|
368
357
|
res.make_request(endpoint="/destinations/list", data={"workspaceId": workspace_id})
|
|
369
358
|
),
|
|
370
359
|
)
|
|
371
360
|
|
|
372
|
-
existing_sources:
|
|
361
|
+
existing_sources: dict[str, InitializedAirbyteSource] = {
|
|
373
362
|
source_json["name"]: InitializedAirbyteSource.from_api_json(source_json)
|
|
374
363
|
for source_json in existing_sources_raw.get("sources", [])
|
|
375
364
|
}
|
|
376
|
-
existing_dests:
|
|
365
|
+
existing_dests: dict[str, InitializedAirbyteDestination] = {
|
|
377
366
|
destination_json["name"]: InitializedAirbyteDestination.from_api_json(destination_json)
|
|
378
367
|
for destination_json in existing_dests_raw.get("destinations", [])
|
|
379
368
|
}
|
|
@@ -433,7 +422,7 @@ def reconcile_normalization(
|
|
|
433
422
|
existing_basic_norm_op_id = None
|
|
434
423
|
if existing_connection_id:
|
|
435
424
|
operations = cast(
|
|
436
|
-
|
|
425
|
+
dict[str, list[dict[str, str]]],
|
|
437
426
|
check.not_none(
|
|
438
427
|
res.make_request(
|
|
439
428
|
endpoint="/operations/list",
|
|
@@ -461,7 +450,7 @@ def reconcile_normalization(
|
|
|
461
450
|
return existing_basic_norm_op_id
|
|
462
451
|
else:
|
|
463
452
|
return cast(
|
|
464
|
-
|
|
453
|
+
dict[str, str],
|
|
465
454
|
check.not_none(
|
|
466
455
|
res.make_request(
|
|
467
456
|
endpoint="/operations/create",
|
|
@@ -503,12 +492,12 @@ def reconcile_connections_pre(
|
|
|
503
492
|
diff = ManagedElementDiff()
|
|
504
493
|
|
|
505
494
|
existing_connections_raw = cast(
|
|
506
|
-
|
|
495
|
+
dict[str, list[dict[str, Any]]],
|
|
507
496
|
check.not_none(
|
|
508
497
|
res.make_request(endpoint="/connections/list", data={"workspaceId": workspace_id})
|
|
509
498
|
),
|
|
510
499
|
)
|
|
511
|
-
existing_connections:
|
|
500
|
+
existing_connections: dict[str, InitializedAirbyteConnection] = {
|
|
512
501
|
connection_json["name"]: InitializedAirbyteConnection.from_api_json(
|
|
513
502
|
connection_json, existing_sources, existing_destinations
|
|
514
503
|
)
|
|
@@ -548,7 +537,7 @@ def reconcile_connections_post(
|
|
|
548
537
|
) -> None:
|
|
549
538
|
"""Creates new and modifies existing connections based on the config if dry_run is False."""
|
|
550
539
|
existing_connections_raw = cast(
|
|
551
|
-
|
|
540
|
+
dict[str, list[dict[str, Any]]],
|
|
552
541
|
check.not_none(
|
|
553
542
|
res.make_request(endpoint="/connections/list", data={"workspaceId": workspace_id})
|
|
554
543
|
),
|
|
@@ -724,9 +713,9 @@ class AirbyteManagedElementCacheableAssetsDefinition(AirbyteInstanceCacheableAss
|
|
|
724
713
|
connection_to_asset_key_fn=connection_to_asset_key_fn,
|
|
725
714
|
connection_to_freshness_policy_fn=connection_to_freshness_policy_fn,
|
|
726
715
|
)
|
|
727
|
-
self._connections:
|
|
716
|
+
self._connections: list[AirbyteConnection] = list(connections)
|
|
728
717
|
|
|
729
|
-
def _get_connections(self) -> Sequence[
|
|
718
|
+
def _get_connections(self) -> Sequence[tuple[str, AirbyteConnectionMetadata]]:
|
|
730
719
|
diff = reconcile_config(self._airbyte_instance, self._connections, dry_run=True)
|
|
731
720
|
if isinstance(diff, ManagedElementDiff) and not diff.is_empty():
|
|
732
721
|
raise ValueError(
|
dagster_airbyte/managed/types.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from abc import ABC
|
|
3
|
+
from collections.abc import Mapping
|
|
3
4
|
from enum import Enum
|
|
4
|
-
from typing import Any,
|
|
5
|
+
from typing import Any, Optional, Union
|
|
5
6
|
|
|
6
7
|
import dagster._check as check
|
|
7
8
|
from dagster._annotations import deprecated, public
|
|
@@ -24,14 +25,14 @@ class AirbyteSyncMode(ABC):
|
|
|
24
25
|
def __eq__(self, other: Any) -> bool:
|
|
25
26
|
return isinstance(other, AirbyteSyncMode) and self.to_json() == other.to_json()
|
|
26
27
|
|
|
27
|
-
def __init__(self, json_repr:
|
|
28
|
+
def __init__(self, json_repr: dict[str, Any]):
|
|
28
29
|
self.json_repr = json_repr
|
|
29
30
|
|
|
30
|
-
def to_json(self) ->
|
|
31
|
+
def to_json(self) -> dict[str, Any]:
|
|
31
32
|
return self.json_repr
|
|
32
33
|
|
|
33
34
|
@classmethod
|
|
34
|
-
def from_json(cls, json_repr:
|
|
35
|
+
def from_json(cls, json_repr: dict[str, Any]) -> "AirbyteSyncMode":
|
|
35
36
|
return cls(
|
|
36
37
|
{
|
|
37
38
|
k: v
|
|
@@ -86,7 +87,7 @@ class AirbyteSyncMode(ABC):
|
|
|
86
87
|
def incremental_append_dedup(
|
|
87
88
|
cls,
|
|
88
89
|
cursor_field: Optional[str] = None,
|
|
89
|
-
primary_key: Optional[Union[str,
|
|
90
|
+
primary_key: Optional[Union[str, list[str]]] = None,
|
|
90
91
|
) -> "AirbyteSyncMode":
|
|
91
92
|
"""Syncs new records from the source, appending to an append-only history
|
|
92
93
|
table in the destination. Also generates a deduplicated view mirroring the
|
|
@@ -349,11 +350,11 @@ class InitializedAirbyteConnection:
|
|
|
349
350
|
)
|
|
350
351
|
|
|
351
352
|
|
|
352
|
-
def _remove_none_values(obj:
|
|
353
|
+
def _remove_none_values(obj: dict[str, Any]) -> dict[str, Any]:
|
|
353
354
|
return {k: v for k, v in obj.items() if v is not None}
|
|
354
355
|
|
|
355
356
|
|
|
356
|
-
def _dump_class(obj: Any) ->
|
|
357
|
+
def _dump_class(obj: Any) -> dict[str, Any]:
|
|
357
358
|
return json.loads(json.dumps(obj, default=lambda o: _remove_none_values(o.__dict__)))
|
|
358
359
|
|
|
359
360
|
|
dagster_airbyte/ops.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from
|
|
1
|
+
from collections.abc import Iterable
|
|
2
|
+
from typing import Any, Optional
|
|
2
3
|
|
|
3
4
|
from dagster import Config, In, Nothing, Out, Output, op
|
|
4
5
|
from dagster._core.storage.tags import COMPUTE_KIND_TAG
|
|
@@ -40,7 +41,7 @@ class AirbyteSyncConfig(Config):
|
|
|
40
41
|
"be yielded when the op executes."
|
|
41
42
|
),
|
|
42
43
|
)
|
|
43
|
-
asset_key_prefix:
|
|
44
|
+
asset_key_prefix: list[str] = Field(
|
|
44
45
|
["airbyte"],
|
|
45
46
|
description=(
|
|
46
47
|
"If provided and yield_materializations is True, these components will be used to "
|
dagster_airbyte/resources.py
CHANGED
|
@@ -4,9 +4,10 @@ import logging
|
|
|
4
4
|
import sys
|
|
5
5
|
import time
|
|
6
6
|
from abc import abstractmethod
|
|
7
|
+
from collections.abc import Mapping, Sequence
|
|
7
8
|
from contextlib import contextmanager
|
|
8
9
|
from datetime import datetime, timedelta
|
|
9
|
-
from typing import Any,
|
|
10
|
+
from typing import Any, Optional, cast
|
|
10
11
|
|
|
11
12
|
import requests
|
|
12
13
|
from dagster import (
|
|
@@ -67,7 +68,7 @@ AIRBYTE_RECONSTRUCTION_METADATA_KEY_PREFIX = "dagster-airbyte/reconstruction_met
|
|
|
67
68
|
|
|
68
69
|
class AirbyteResourceState:
|
|
69
70
|
def __init__(self) -> None:
|
|
70
|
-
self.request_cache:
|
|
71
|
+
self.request_cache: dict[str, Optional[Mapping[str, object]]] = {}
|
|
71
72
|
# Int in case we nest contexts
|
|
72
73
|
self.cache_enabled = 0
|
|
73
74
|
|
|
@@ -143,7 +144,7 @@ class BaseAirbyteResource(ConfigurableResource):
|
|
|
143
144
|
num_retries = 0
|
|
144
145
|
while True:
|
|
145
146
|
try:
|
|
146
|
-
request_args:
|
|
147
|
+
request_args: dict[str, Any] = dict(
|
|
147
148
|
method=method,
|
|
148
149
|
url=url,
|
|
149
150
|
headers=headers,
|
|
@@ -216,7 +217,7 @@ class BaseAirbyteResource(ConfigurableResource):
|
|
|
216
217
|
"""
|
|
217
218
|
connection_details = self.get_connection_details(connection_id)
|
|
218
219
|
job_details = self.start_sync(connection_id)
|
|
219
|
-
job_info = cast(
|
|
220
|
+
job_info = cast(dict[str, object], job_details.get("job", {}))
|
|
220
221
|
job_id = cast(int, job_info.get("id"))
|
|
221
222
|
|
|
222
223
|
self._log.info(f"Job {job_id} initialized for connection_id={connection_id}.")
|
|
@@ -234,7 +235,7 @@ class BaseAirbyteResource(ConfigurableResource):
|
|
|
234
235
|
)
|
|
235
236
|
time.sleep(poll_interval or self.poll_interval)
|
|
236
237
|
job_details = self.get_job_status(connection_id, job_id)
|
|
237
|
-
attempts = cast(
|
|
238
|
+
attempts = cast(list, job_details.get("attempts", []))
|
|
238
239
|
cur_attempt = len(attempts)
|
|
239
240
|
# spit out the available Airbyte log info
|
|
240
241
|
if cur_attempt:
|
|
@@ -251,7 +252,7 @@ class BaseAirbyteResource(ConfigurableResource):
|
|
|
251
252
|
logged_lines = 0
|
|
252
253
|
logged_attempts += 1
|
|
253
254
|
|
|
254
|
-
job_info = cast(
|
|
255
|
+
job_info = cast(dict[str, object], job_details.get("job", {}))
|
|
255
256
|
state = job_info.get("status")
|
|
256
257
|
|
|
257
258
|
if state in (
|
|
@@ -570,7 +571,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
570
571
|
|
|
571
572
|
def get_default_workspace(self) -> str:
|
|
572
573
|
workspaces = cast(
|
|
573
|
-
|
|
574
|
+
list[dict[str, Any]],
|
|
574
575
|
check.not_none(self.make_request_cached(endpoint="/workspaces/list", data={})).get(
|
|
575
576
|
"workspaces", []
|
|
576
577
|
),
|
|
@@ -582,7 +583,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
582
583
|
definitions = check.not_none(
|
|
583
584
|
self.make_request_cached(endpoint="/source_definitions/list", data={})
|
|
584
585
|
)
|
|
585
|
-
source_definitions = cast(
|
|
586
|
+
source_definitions = cast(list[dict[str, Any]], definitions["sourceDefinitions"])
|
|
586
587
|
|
|
587
588
|
return next(
|
|
588
589
|
(
|
|
@@ -596,7 +597,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
596
597
|
def get_destination_definition_by_name(self, name: str):
|
|
597
598
|
name_lower = name.lower()
|
|
598
599
|
definitions = cast(
|
|
599
|
-
|
|
600
|
+
dict[str, list[dict[str, str]]],
|
|
600
601
|
check.not_none(
|
|
601
602
|
self.make_request_cached(endpoint="/destination_definitions/list", data={})
|
|
602
603
|
),
|
|
@@ -612,7 +613,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
612
613
|
|
|
613
614
|
def get_source_catalog_id(self, source_id: str):
|
|
614
615
|
result = cast(
|
|
615
|
-
|
|
616
|
+
dict[str, Any],
|
|
616
617
|
check.not_none(
|
|
617
618
|
self.make_request(endpoint="/sources/discover_schema", data={"sourceId": source_id})
|
|
618
619
|
),
|
|
@@ -621,7 +622,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
621
622
|
|
|
622
623
|
def get_source_schema(self, source_id: str) -> Mapping[str, Any]:
|
|
623
624
|
return cast(
|
|
624
|
-
|
|
625
|
+
dict[str, Any],
|
|
625
626
|
check.not_none(
|
|
626
627
|
self.make_request(endpoint="/sources/discover_schema", data={"sourceId": source_id})
|
|
627
628
|
),
|
|
@@ -633,7 +634,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
633
634
|
# Airbyte API changed source of truth for normalization in PR
|
|
634
635
|
# https://github.com/airbytehq/airbyte/pull/21005
|
|
635
636
|
norm_dest_def_spec: bool = cast(
|
|
636
|
-
|
|
637
|
+
dict[str, Any],
|
|
637
638
|
check.not_none(
|
|
638
639
|
self.make_request_cached(
|
|
639
640
|
endpoint="/destination_definition_specifications/get",
|
|
@@ -647,7 +648,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
647
648
|
|
|
648
649
|
norm_dest_def: bool = (
|
|
649
650
|
cast(
|
|
650
|
-
|
|
651
|
+
dict[str, Any],
|
|
651
652
|
check.not_none(
|
|
652
653
|
self.make_request_cached(
|
|
653
654
|
endpoint="/destination_definitions/get",
|
|
@@ -680,7 +681,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
680
681
|
},
|
|
681
682
|
)
|
|
682
683
|
)
|
|
683
|
-
job = next((job for job in cast(
|
|
684
|
+
job = next((job for job in cast(list, out["jobs"]) if job["job"]["id"] == job_id), None)
|
|
684
685
|
|
|
685
686
|
return check.not_none(job)
|
|
686
687
|
|
|
@@ -715,7 +716,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
715
716
|
"""
|
|
716
717
|
connection_details = self.get_connection_details(connection_id)
|
|
717
718
|
job_details = self.start_sync(connection_id)
|
|
718
|
-
job_info = cast(
|
|
719
|
+
job_info = cast(dict[str, object], job_details.get("job", {}))
|
|
719
720
|
job_id = cast(int, job_info.get("id"))
|
|
720
721
|
|
|
721
722
|
self._log.info(f"Job {job_id} initialized for connection_id={connection_id}.")
|
|
@@ -733,7 +734,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
733
734
|
)
|
|
734
735
|
time.sleep(poll_interval or self.poll_interval)
|
|
735
736
|
job_details = self.get_job_status(connection_id, job_id)
|
|
736
|
-
attempts = cast(
|
|
737
|
+
attempts = cast(list, job_details.get("attempts", []))
|
|
737
738
|
cur_attempt = len(attempts)
|
|
738
739
|
# spit out the available Airbyte log info
|
|
739
740
|
if cur_attempt:
|
|
@@ -750,7 +751,7 @@ class AirbyteResource(BaseAirbyteResource):
|
|
|
750
751
|
logged_lines = 0
|
|
751
752
|
logged_attempts += 1
|
|
752
753
|
|
|
753
|
-
job_info = cast(
|
|
754
|
+
job_info = cast(dict[str, object], job_details.get("job", {}))
|
|
754
755
|
state = job_info.get("status")
|
|
755
756
|
|
|
756
757
|
if state in (
|
dagster_airbyte/translator.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
from collections.abc import Mapping, Sequence
|
|
1
2
|
from enum import Enum
|
|
2
|
-
from typing import Any,
|
|
3
|
+
from typing import Any, Optional
|
|
3
4
|
|
|
4
5
|
from dagster._annotations import deprecated, experimental
|
|
5
6
|
from dagster._core.definitions.asset_key import AssetKey
|
|
@@ -164,7 +165,7 @@ class AirbyteWorkspaceData:
|
|
|
164
165
|
"""Method that converts a `AirbyteWorkspaceData` object
|
|
165
166
|
to a collection of `AirbyteConnectionTableProps` objects.
|
|
166
167
|
"""
|
|
167
|
-
data:
|
|
168
|
+
data: list[AirbyteConnectionTableProps] = []
|
|
168
169
|
|
|
169
170
|
for connection in self.connections_by_id.values():
|
|
170
171
|
destination = self.destinations_by_id[connection.destination_id]
|
dagster_airbyte/types.py
CHANGED
dagster_airbyte/utils.py
CHANGED
dagster_airbyte/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.25.
|
|
1
|
+
__version__ = "0.25.9"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dagster-airbyte
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.9
|
|
4
4
|
Summary: Package for integrating Airbyte with Dagster.
|
|
5
5
|
Home-page: https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-airbyte
|
|
6
6
|
Author: Dagster Labs
|
|
@@ -14,10 +14,10 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Requires-Python: >=3.9,<3.13
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: dagster ==1.9.
|
|
17
|
+
Requires-Dist: dagster ==1.9.9
|
|
18
18
|
Requires-Dist: requests
|
|
19
19
|
Provides-Extra: managed
|
|
20
|
-
Requires-Dist: dagster-managed-elements ==0.25.
|
|
20
|
+
Requires-Dist: dagster-managed-elements ==0.25.9 ; extra == 'managed'
|
|
21
21
|
Provides-Extra: test
|
|
22
22
|
Requires-Dist: requests-mock ; extra == 'test'
|
|
23
23
|
Requires-Dist: flaky ; extra == 'test'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
dagster_airbyte/__init__.py,sha256=T3mFUhqESk-F0FISreWfuLzULKYCO67WtGzbxGVUxdY,1719
|
|
2
|
+
dagster_airbyte/asset_decorator.py,sha256=s0wFVFqe8kOGSiwyZx9n96C-_tnYfGuxsf_qefeFjJU,4209
|
|
3
|
+
dagster_airbyte/asset_defs.py,sha256=039JPL5Jy0WP34K3JUO3hvQpbBLVLMOqY0bgyh73VHA,50059
|
|
4
|
+
dagster_airbyte/cli.py,sha256=HErteP1MjfHozKKSrznh0yAreKETbXp5NDHzXGsdvvE,425
|
|
5
|
+
dagster_airbyte/ops.py,sha256=oOEczVYpqVRTc1-0osfpR5FZbPjNJDYihgRjk_qtOQA,4229
|
|
6
|
+
dagster_airbyte/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
|
|
7
|
+
dagster_airbyte/resources.py,sha256=PhRaLAiYtN83vk3sqhzebhw605DYF1ZY6Q87XvG0KRs,53552
|
|
8
|
+
dagster_airbyte/translator.py,sha256=jOdBA5cDb1dRIgJZlqQv_SzqPRzvnm9N-UmA0yK_tsI,7546
|
|
9
|
+
dagster_airbyte/types.py,sha256=Pc3X0BGYo2dabRGUJf0TinSNoW_QHFOEioTyAN0NCyc,1571
|
|
10
|
+
dagster_airbyte/utils.py,sha256=wJtzx5cWq8Bp1f3T4XjLPaxjXZGstHlL4kRYP2c49bs,4157
|
|
11
|
+
dagster_airbyte/version.py,sha256=NsKiCCQq5j7wW1paL-Bw27h63w_P0r0bIHvsX9TsjGY,23
|
|
12
|
+
dagster_airbyte/managed/__init__.py,sha256=6SBtyNOMJ9Cu2UIwFExJHpL_ZVFo3rPMvyIxVOsKvWE,469
|
|
13
|
+
dagster_airbyte/managed/reconciliation.py,sha256=K-n2_nPwLQrsZSXSo7a0AcAjglMDsvhRErb5zmxlu7E,34814
|
|
14
|
+
dagster_airbyte/managed/types.py,sha256=isPfX8L9YwtZAf9Vk4hhxBePLR00AEldsdK2TsM1H2o,14611
|
|
15
|
+
dagster_airbyte/managed/generated/__init__.py,sha256=eYq-yfXEeffuKAVFXY8plD0se1wHjFNVqklpbu9gljw,108
|
|
16
|
+
dagster_airbyte/managed/generated/destinations.py,sha256=x1wmWlXvOJHtfaZva3ErdKuVS--sDvfidSXR5ji9G5w,119692
|
|
17
|
+
dagster_airbyte/managed/generated/sources.py,sha256=y0TPNvcRd8c9mhje-NoXsHeKRPt1nXcpww8mNAtqCps,282685
|
|
18
|
+
dagster_airbyte-0.25.9.dist-info/LICENSE,sha256=TMatHW4_G9ldRdodEAp-l2Xa2WvsdeOh60E3v1R2jis,11349
|
|
19
|
+
dagster_airbyte-0.25.9.dist-info/METADATA,sha256=2ULSdfUfVGJDRngA2bVZ2-3PSvylbQSNBoYyjMFjVBg,915
|
|
20
|
+
dagster_airbyte-0.25.9.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
21
|
+
dagster_airbyte-0.25.9.dist-info/entry_points.txt,sha256=XrbLOz3LpgPV5fdwMmgdP6Rp1AfSG07KeWIddLqh7Lw,61
|
|
22
|
+
dagster_airbyte-0.25.9.dist-info/top_level.txt,sha256=HLwIRQCzqItn88_KbPP8DNTKKQEBUVKk6NCn4PrCtqY,16
|
|
23
|
+
dagster_airbyte-0.25.9.dist-info/RECORD,,
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
dagster_airbyte/__init__.py,sha256=T3mFUhqESk-F0FISreWfuLzULKYCO67WtGzbxGVUxdY,1719
|
|
2
|
-
dagster_airbyte/asset_decorator.py,sha256=s0wFVFqe8kOGSiwyZx9n96C-_tnYfGuxsf_qefeFjJU,4209
|
|
3
|
-
dagster_airbyte/asset_defs.py,sha256=UXp4CE6dVsWdbFn_iaHf-YE4Q3AAn6MgKxnvPY9d_Hk,50113
|
|
4
|
-
dagster_airbyte/cli.py,sha256=HErteP1MjfHozKKSrznh0yAreKETbXp5NDHzXGsdvvE,425
|
|
5
|
-
dagster_airbyte/ops.py,sha256=pq6mp7vN2wXgo3gJMuWaAcxTmfkZ7d1zWzPyL_auSEY,4208
|
|
6
|
-
dagster_airbyte/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
|
|
7
|
-
dagster_airbyte/resources.py,sha256=dmInsuuhYYo1ys4V7V4CGoTp-0uy05sk4HtNJVW9i9A,53537
|
|
8
|
-
dagster_airbyte/translator.py,sha256=jqURbuSRu4dtpwDXIO6hGdcVoQFmWOBzXCLHtPiDOfQ,7525
|
|
9
|
-
dagster_airbyte/types.py,sha256=w1DyTcXyuzrG3wfkOPYFtwj7snHcgqf-dC7_pRjiE1Q,1544
|
|
10
|
-
dagster_airbyte/utils.py,sha256=qRAZY2MGpWmFHfU7ibUHXPyye2dZFz0MabusOeEbnSI,4130
|
|
11
|
-
dagster_airbyte/version.py,sha256=C9UDSxAgbu6RAIQvHS6_OpZMJWGe74K5VElCoECo0YA,23
|
|
12
|
-
dagster_airbyte/managed/__init__.py,sha256=6SBtyNOMJ9Cu2UIwFExJHpL_ZVFo3rPMvyIxVOsKvWE,469
|
|
13
|
-
dagster_airbyte/managed/reconciliation.py,sha256=Im5fiT2qWRKqO4vYugpsSiCICoCKo3_gjXRO2UcR0XM,34855
|
|
14
|
-
dagster_airbyte/managed/types.py,sha256=ja056Wm7_ZFw1XGSNmdxmBy2TcOxbnylJCpRA2ng2TE,14596
|
|
15
|
-
dagster_airbyte/managed/generated/__init__.py,sha256=eYq-yfXEeffuKAVFXY8plD0se1wHjFNVqklpbu9gljw,108
|
|
16
|
-
dagster_airbyte/managed/generated/destinations.py,sha256=x1wmWlXvOJHtfaZva3ErdKuVS--sDvfidSXR5ji9G5w,119692
|
|
17
|
-
dagster_airbyte/managed/generated/sources.py,sha256=wyNoGJiNvW8mjRRs6b-_lWFs0Fgy-MZlRaxiN6bP-4s,282691
|
|
18
|
-
dagster_airbyte-0.25.7.dist-info/LICENSE,sha256=TMatHW4_G9ldRdodEAp-l2Xa2WvsdeOh60E3v1R2jis,11349
|
|
19
|
-
dagster_airbyte-0.25.7.dist-info/METADATA,sha256=JMWqFNAPgNVwRyPlfNOWPxbD_nG38gTL4x56zjtfI8c,915
|
|
20
|
-
dagster_airbyte-0.25.7.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
21
|
-
dagster_airbyte-0.25.7.dist-info/entry_points.txt,sha256=XrbLOz3LpgPV5fdwMmgdP6Rp1AfSG07KeWIddLqh7Lw,61
|
|
22
|
-
dagster_airbyte-0.25.7.dist-info/top_level.txt,sha256=HLwIRQCzqItn88_KbPP8DNTKKQEBUVKk6NCn4PrCtqY,16
|
|
23
|
-
dagster_airbyte-0.25.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|