dagster-airbyte 0.24.13__py3-none-any.whl → 0.25.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.
Potentially problematic release.
This version of dagster-airbyte might be problematic. Click here for more details.
- dagster_airbyte/__init__.py +0 -1
- dagster_airbyte/asset_defs.py +9 -138
- dagster_airbyte/version.py +1 -1
- {dagster_airbyte-0.24.13.dist-info → dagster_airbyte-0.25.0.dist-info}/METADATA +4 -5
- {dagster_airbyte-0.24.13.dist-info → dagster_airbyte-0.25.0.dist-info}/RECORD +9 -9
- {dagster_airbyte-0.24.13.dist-info → dagster_airbyte-0.25.0.dist-info}/LICENSE +0 -0
- {dagster_airbyte-0.24.13.dist-info → dagster_airbyte-0.25.0.dist-info}/WHEEL +0 -0
- {dagster_airbyte-0.24.13.dist-info → dagster_airbyte-0.25.0.dist-info}/entry_points.txt +0 -0
- {dagster_airbyte-0.24.13.dist-info → dagster_airbyte-0.25.0.dist-info}/top_level.txt +0 -0
dagster_airbyte/__init__.py
CHANGED
|
@@ -17,7 +17,6 @@ except ImportError:
|
|
|
17
17
|
from dagster_airbyte.asset_defs import (
|
|
18
18
|
build_airbyte_assets as build_airbyte_assets,
|
|
19
19
|
load_assets_from_airbyte_instance as load_assets_from_airbyte_instance,
|
|
20
|
-
load_assets_from_airbyte_project as load_assets_from_airbyte_project,
|
|
21
20
|
)
|
|
22
21
|
from dagster_airbyte.ops import airbyte_sync_op as airbyte_sync_op
|
|
23
22
|
from dagster_airbyte.resources import (
|
dagster_airbyte/asset_defs.py
CHANGED
|
@@ -33,7 +33,6 @@ from dagster import (
|
|
|
33
33
|
SourceAsset,
|
|
34
34
|
_check as check,
|
|
35
35
|
)
|
|
36
|
-
from dagster._annotations import deprecated
|
|
37
36
|
from dagster._core.definitions import AssetsDefinition, multi_asset
|
|
38
37
|
from dagster._core.definitions.cacheable_assets import (
|
|
39
38
|
AssetsDefinitionCacheableData,
|
|
@@ -116,11 +115,11 @@ def _build_airbyte_asset_defn_metadata(
|
|
|
116
115
|
for table in destination_tables:
|
|
117
116
|
internal_deps[table] = set(upstream_assets or [])
|
|
118
117
|
|
|
119
|
-
|
|
118
|
+
table_names: Dict[str, str] = {}
|
|
120
119
|
for table in destination_tables:
|
|
121
120
|
if destination_database and destination_schema and table:
|
|
122
|
-
# Use the destination raw table name to create the
|
|
123
|
-
|
|
121
|
+
# Use the destination raw table name to create the table name
|
|
122
|
+
table_names[table] = ".".join(
|
|
124
123
|
[
|
|
125
124
|
destination_database,
|
|
126
125
|
destination_schema,
|
|
@@ -129,7 +128,7 @@ def _build_airbyte_asset_defn_metadata(
|
|
|
129
128
|
)
|
|
130
129
|
if normalization_tables and normalization_raw_table_names_by_table:
|
|
131
130
|
for normalization_table in normalization_tables.get(table, set()):
|
|
132
|
-
|
|
131
|
+
table_names[normalization_table] = ".".join(
|
|
133
132
|
[
|
|
134
133
|
destination_database,
|
|
135
134
|
destination_schema,
|
|
@@ -156,7 +155,7 @@ def _build_airbyte_asset_defn_metadata(
|
|
|
156
155
|
table: {
|
|
157
156
|
**TableMetadataSet(
|
|
158
157
|
column_schema=schema_by_table_name.get(table),
|
|
159
|
-
|
|
158
|
+
table_name=table_names.get(table),
|
|
160
159
|
),
|
|
161
160
|
}
|
|
162
161
|
for table in tables
|
|
@@ -302,15 +301,13 @@ def build_airbyte_assets(
|
|
|
302
301
|
chain([destination_tables], normalization_tables.values() if normalization_tables else [])
|
|
303
302
|
)
|
|
304
303
|
|
|
305
|
-
|
|
304
|
+
table_names: Dict[str, str] = {}
|
|
306
305
|
for table in destination_tables:
|
|
307
306
|
if destination_database and destination_schema and table:
|
|
308
|
-
|
|
309
|
-
[destination_database, destination_schema, table]
|
|
310
|
-
)
|
|
307
|
+
table_names[table] = ".".join([destination_database, destination_schema, table])
|
|
311
308
|
if normalization_tables:
|
|
312
309
|
for normalization_table in normalization_tables.get(table, set()):
|
|
313
|
-
|
|
310
|
+
table_names[normalization_table] = ".".join(
|
|
314
311
|
[
|
|
315
312
|
destination_database,
|
|
316
313
|
destination_schema,
|
|
@@ -328,7 +325,7 @@ def build_airbyte_assets(
|
|
|
328
325
|
{
|
|
329
326
|
**TableMetadataSet(
|
|
330
327
|
column_schema=schema_by_table_name.get(table),
|
|
331
|
-
|
|
328
|
+
table_name=table_names.get(table),
|
|
332
329
|
),
|
|
333
330
|
}
|
|
334
331
|
),
|
|
@@ -1035,129 +1032,3 @@ def load_assets_from_airbyte_instance(
|
|
|
1035
1032
|
connection_to_freshness_policy_fn=connection_to_freshness_policy_fn,
|
|
1036
1033
|
connection_to_auto_materialize_policy_fn=connection_to_auto_materialize_policy_fn,
|
|
1037
1034
|
)
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
@deprecated(
|
|
1041
|
-
breaking_version="1.9",
|
|
1042
|
-
additional_warn_text="The Airbyte Octavia CLI has been deprecated. Consider using load_assets_from_airbyte_instance instead.",
|
|
1043
|
-
)
|
|
1044
|
-
def load_assets_from_airbyte_project(
|
|
1045
|
-
project_dir: str,
|
|
1046
|
-
workspace_id: Optional[str] = None,
|
|
1047
|
-
key_prefix: Optional[CoercibleToAssetKeyPrefix] = None,
|
|
1048
|
-
create_assets_for_normalization_tables: bool = True,
|
|
1049
|
-
connection_to_group_fn: Optional[Callable[[str], Optional[str]]] = _clean_name,
|
|
1050
|
-
connection_meta_to_group_fn: Optional[
|
|
1051
|
-
Callable[[AirbyteConnectionMetadata], Optional[str]]
|
|
1052
|
-
] = None,
|
|
1053
|
-
io_manager_key: Optional[str] = None,
|
|
1054
|
-
connection_to_io_manager_key_fn: Optional[Callable[[str], Optional[str]]] = None,
|
|
1055
|
-
connection_filter: Optional[Callable[[AirbyteConnectionMetadata], bool]] = None,
|
|
1056
|
-
connection_directories: Optional[Sequence[str]] = None,
|
|
1057
|
-
connection_to_asset_key_fn: Optional[
|
|
1058
|
-
Callable[[AirbyteConnectionMetadata, str], AssetKey]
|
|
1059
|
-
] = None,
|
|
1060
|
-
connection_to_freshness_policy_fn: Optional[
|
|
1061
|
-
Callable[[AirbyteConnectionMetadata], Optional[FreshnessPolicy]]
|
|
1062
|
-
] = None,
|
|
1063
|
-
connection_to_auto_materialize_policy_fn: Optional[
|
|
1064
|
-
Callable[[AirbyteConnectionMetadata], Optional[AutoMaterializePolicy]]
|
|
1065
|
-
] = None,
|
|
1066
|
-
) -> CacheableAssetsDefinition:
|
|
1067
|
-
"""Loads an Airbyte project into a set of Dagster assets.
|
|
1068
|
-
|
|
1069
|
-
Point to the root folder of an Airbyte project synced using the Octavia CLI. For
|
|
1070
|
-
more information, see https://airbyte.com/tutorials/version-control-airbyte-configurations.
|
|
1071
|
-
|
|
1072
|
-
Args:
|
|
1073
|
-
project_dir (str): The path to the root of your Airbyte project, containing sources, destinations,
|
|
1074
|
-
and connections folders.
|
|
1075
|
-
workspace_id (Optional[str]): The ID of the Airbyte workspace to load connections from. Only
|
|
1076
|
-
required if multiple workspace state YAMLfiles exist in the project.
|
|
1077
|
-
key_prefix (Optional[CoercibleToAssetKeyPrefix]): A prefix for the asset keys created.
|
|
1078
|
-
create_assets_for_normalization_tables (bool): If True, assets will be created for tables
|
|
1079
|
-
created by Airbyte's normalization feature. If False, only the destination tables
|
|
1080
|
-
will be created. Defaults to True.
|
|
1081
|
-
connection_to_group_fn (Optional[Callable[[str], Optional[str]]]): Function which returns an asset
|
|
1082
|
-
group name for a given Airbyte connection name. If None, no groups will be created. Defaults
|
|
1083
|
-
to a basic sanitization function.
|
|
1084
|
-
connection_meta_to_group_fn (Optional[Callable[[AirbyteConnectionMetadata], Optional[str]]]): Function
|
|
1085
|
-
which returns an asset group name for a given Airbyte connection metadata. If None and connection_to_group_fn
|
|
1086
|
-
is None, no groups will be created. Defaults to None.
|
|
1087
|
-
io_manager_key (Optional[str]): The I/O manager key to use for all assets. Defaults to "io_manager".
|
|
1088
|
-
Use this if all assets should be loaded from the same source, otherwise use connection_to_io_manager_key_fn.
|
|
1089
|
-
connection_to_io_manager_key_fn (Optional[Callable[[str], Optional[str]]]): Function which returns an
|
|
1090
|
-
I/O manager key for a given Airbyte connection name. When other ops are downstream of the loaded assets,
|
|
1091
|
-
the IOManager specified determines how the inputs to those ops are loaded. Defaults to "io_manager".
|
|
1092
|
-
connection_filter (Optional[Callable[[AirbyteConnectionMetadata], bool]]): Optional function which
|
|
1093
|
-
takes in connection metadata and returns False if the connection should be excluded from the output assets.
|
|
1094
|
-
connection_directories (Optional[List[str]]): Optional list of connection directories to load assets from.
|
|
1095
|
-
If omitted, all connections in the Airbyte project are loaded. May be faster than connection_filter
|
|
1096
|
-
if the project has many connections or if the connection yaml files are large.
|
|
1097
|
-
connection_to_asset_key_fn (Optional[Callable[[AirbyteConnectionMetadata, str], AssetKey]]): Optional function which
|
|
1098
|
-
takes in connection metadata and table name and returns an asset key for the table. If None, the default asset
|
|
1099
|
-
key is based on the table name. Any asset key prefix will be applied to the output of this function.
|
|
1100
|
-
connection_to_freshness_policy_fn (Optional[Callable[[AirbyteConnectionMetadata], Optional[FreshnessPolicy]]]):
|
|
1101
|
-
Optional function which takes in connection metadata and returns a freshness policy for the connection's assets.
|
|
1102
|
-
If None, no freshness policies will be applied to the assets.
|
|
1103
|
-
connection_to_auto_materialize_policy_fn (Optional[Callable[[AirbyteConnectionMetadata], Optional[AutoMaterializePolicy]]]):
|
|
1104
|
-
Optional function which takes in connection metadata and returns an auto materialization policy for the connection's assets.
|
|
1105
|
-
If None, no auto materialization policies will be applied to the assets.
|
|
1106
|
-
|
|
1107
|
-
**Examples:**
|
|
1108
|
-
|
|
1109
|
-
Loading all Airbyte connections as assets:
|
|
1110
|
-
|
|
1111
|
-
.. code-block:: python
|
|
1112
|
-
|
|
1113
|
-
from dagster_airbyte import load_assets_from_airbyte_project
|
|
1114
|
-
|
|
1115
|
-
airbyte_assets = load_assets_from_airbyte_project(
|
|
1116
|
-
project_dir="path/to/airbyte/project",
|
|
1117
|
-
)
|
|
1118
|
-
|
|
1119
|
-
Filtering the set of loaded connections:
|
|
1120
|
-
|
|
1121
|
-
.. code-block:: python
|
|
1122
|
-
|
|
1123
|
-
from dagster_airbyte import load_assets_from_airbyte_project
|
|
1124
|
-
|
|
1125
|
-
airbyte_assets = load_assets_from_airbyte_project(
|
|
1126
|
-
project_dir="path/to/airbyte/project",
|
|
1127
|
-
connection_filter=lambda meta: "snowflake" in meta.name,
|
|
1128
|
-
)
|
|
1129
|
-
"""
|
|
1130
|
-
if isinstance(key_prefix, str):
|
|
1131
|
-
key_prefix = [key_prefix]
|
|
1132
|
-
key_prefix = check.list_param(key_prefix or [], "key_prefix", of_type=str)
|
|
1133
|
-
|
|
1134
|
-
check.invariant(
|
|
1135
|
-
not io_manager_key or not connection_to_io_manager_key_fn,
|
|
1136
|
-
"Cannot specify both io_manager_key and connection_to_io_manager_key_fn",
|
|
1137
|
-
)
|
|
1138
|
-
if not connection_to_io_manager_key_fn:
|
|
1139
|
-
connection_to_io_manager_key_fn = lambda _: io_manager_key
|
|
1140
|
-
|
|
1141
|
-
check.invariant(
|
|
1142
|
-
not connection_meta_to_group_fn
|
|
1143
|
-
or not connection_to_group_fn
|
|
1144
|
-
or connection_to_group_fn == _clean_name,
|
|
1145
|
-
"Cannot specify both connection_meta_to_group_fn and connection_to_group_fn",
|
|
1146
|
-
)
|
|
1147
|
-
|
|
1148
|
-
if not connection_meta_to_group_fn and connection_to_group_fn:
|
|
1149
|
-
connection_meta_to_group_fn = lambda meta: connection_to_group_fn(meta.name)
|
|
1150
|
-
|
|
1151
|
-
return AirbyteYAMLCacheableAssetsDefinition(
|
|
1152
|
-
project_dir=project_dir,
|
|
1153
|
-
workspace_id=workspace_id,
|
|
1154
|
-
key_prefix=key_prefix,
|
|
1155
|
-
create_assets_for_normalization_tables=create_assets_for_normalization_tables,
|
|
1156
|
-
connection_meta_to_group_fn=connection_meta_to_group_fn,
|
|
1157
|
-
connection_to_io_manager_key_fn=connection_to_io_manager_key_fn,
|
|
1158
|
-
connection_filter=connection_filter,
|
|
1159
|
-
connection_directories=connection_directories,
|
|
1160
|
-
connection_to_asset_key_fn=connection_to_asset_key_fn,
|
|
1161
|
-
connection_to_freshness_policy_fn=connection_to_freshness_policy_fn,
|
|
1162
|
-
connection_to_auto_materialize_policy_fn=connection_to_auto_materialize_policy_fn,
|
|
1163
|
-
)
|
dagster_airbyte/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.25.0"
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dagster-airbyte
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.25.0
|
|
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
|
|
7
7
|
Author-email: hello@dagsterlabs.com
|
|
8
8
|
License: Apache-2.0
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
10
9
|
Classifier: Programming Language :: Python :: 3.9
|
|
11
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
13
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
14
|
Classifier: Operating System :: OS Independent
|
|
16
|
-
Requires-Python: >=3.
|
|
15
|
+
Requires-Python: >=3.9,<3.13
|
|
17
16
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: dagster ==1.
|
|
17
|
+
Requires-Dist: dagster ==1.9.0
|
|
19
18
|
Requires-Dist: requests
|
|
20
19
|
Provides-Extra: managed
|
|
21
|
-
Requires-Dist: dagster-managed-elements ==0.
|
|
20
|
+
Requires-Dist: dagster-managed-elements ==0.25.0 ; extra == 'managed'
|
|
22
21
|
Provides-Extra: test
|
|
23
22
|
Requires-Dist: requests-mock ; extra == 'test'
|
|
24
23
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
dagster_airbyte/__init__.py,sha256=
|
|
2
|
-
dagster_airbyte/asset_defs.py,sha256=
|
|
1
|
+
dagster_airbyte/__init__.py,sha256=DpJXhv73w1oKpWnXRRfItCTb61oEZR3FJzyMZzBgRfM,1231
|
|
2
|
+
dagster_airbyte/asset_defs.py,sha256=UFzHdNRgFPNU8xqDGcD-ce-J9I82HIj3N2GN5tg8G_Y,46039
|
|
3
3
|
dagster_airbyte/cli.py,sha256=HErteP1MjfHozKKSrznh0yAreKETbXp5NDHzXGsdvvE,425
|
|
4
4
|
dagster_airbyte/ops.py,sha256=pq6mp7vN2wXgo3gJMuWaAcxTmfkZ7d1zWzPyL_auSEY,4208
|
|
5
5
|
dagster_airbyte/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
|
|
6
6
|
dagster_airbyte/resources.py,sha256=FoHI_Eiw2F6tnI1KZMfkgXhThdU6DplHp6INsbjUFsg,29802
|
|
7
7
|
dagster_airbyte/types.py,sha256=w1DyTcXyuzrG3wfkOPYFtwj7snHcgqf-dC7_pRjiE1Q,1544
|
|
8
8
|
dagster_airbyte/utils.py,sha256=cFKCkGFAvwr17KFTeqpVtQRDsNo4zpqw9yr2-1YSJeI,2823
|
|
9
|
-
dagster_airbyte/version.py,sha256=
|
|
9
|
+
dagster_airbyte/version.py,sha256=Mu4JbSLl5nr-J2figk5hmW2mrw4skf_oeIzxbnpcgwY,23
|
|
10
10
|
dagster_airbyte/managed/__init__.py,sha256=6SBtyNOMJ9Cu2UIwFExJHpL_ZVFo3rPMvyIxVOsKvWE,469
|
|
11
11
|
dagster_airbyte/managed/reconciliation.py,sha256=HgrLT-Xs8vWY9SfbdBXuorMf60KCn5Qz7bPITW5MxJo,34862
|
|
12
12
|
dagster_airbyte/managed/types.py,sha256=ja056Wm7_ZFw1XGSNmdxmBy2TcOxbnylJCpRA2ng2TE,14596
|
|
13
13
|
dagster_airbyte/managed/generated/__init__.py,sha256=eYq-yfXEeffuKAVFXY8plD0se1wHjFNVqklpbu9gljw,108
|
|
14
14
|
dagster_airbyte/managed/generated/destinations.py,sha256=x1wmWlXvOJHtfaZva3ErdKuVS--sDvfidSXR5ji9G5w,119692
|
|
15
15
|
dagster_airbyte/managed/generated/sources.py,sha256=wyNoGJiNvW8mjRRs6b-_lWFs0Fgy-MZlRaxiN6bP-4s,282691
|
|
16
|
-
dagster_airbyte-0.
|
|
17
|
-
dagster_airbyte-0.
|
|
18
|
-
dagster_airbyte-0.
|
|
19
|
-
dagster_airbyte-0.
|
|
20
|
-
dagster_airbyte-0.
|
|
21
|
-
dagster_airbyte-0.
|
|
16
|
+
dagster_airbyte-0.25.0.dist-info/LICENSE,sha256=TMatHW4_G9ldRdodEAp-l2Xa2WvsdeOh60E3v1R2jis,11349
|
|
17
|
+
dagster_airbyte-0.25.0.dist-info/METADATA,sha256=et8s1-ISVtc1doheso3hjYjhvfFi0jDIf0TuxSXzAGc,876
|
|
18
|
+
dagster_airbyte-0.25.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
19
|
+
dagster_airbyte-0.25.0.dist-info/entry_points.txt,sha256=XrbLOz3LpgPV5fdwMmgdP6Rp1AfSG07KeWIddLqh7Lw,61
|
|
20
|
+
dagster_airbyte-0.25.0.dist-info/top_level.txt,sha256=HLwIRQCzqItn88_KbPP8DNTKKQEBUVKk6NCn4PrCtqY,16
|
|
21
|
+
dagster_airbyte-0.25.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|