-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14/n][dagster-airbyte] Implement materialization method for AirbyteC…
…loudWorkspace (#26559) ## Summary & Motivation This PR implements `AirbyteCloudWorkspace.sync_and_poll`, the materialization method for Airbyte Cloud assets. This method: - calls `AirbyteCloudClient.sync_and_poll` - takes the AirbyteOutput returned by `AirbyteCloudClient.sync_and_poll` and generates the asset materializations - yields `MaterializeResult` for each expected asset and `AssetMaterialization` for each unexpected asset - a connection table that was not in the connection at definitions loading time can be in the AirbyteOutput. Eg. the table was added after definitions loading time and before sync. - logs a warning for each unmaterialized table - a connection table can be created at definitions loading time, but can be missing in the AirbyteOutput. Eg. the table was deleted after definitions loading time and before sync. Can be leveraged like: ```python from dagster_airbyte import AirbyteCloudWorkspace, airbyte_assets import dagster as dg airbyte_workspace = AirbyteCloudWorkspace( workspace_id=dg.EnvVar("AIRBYTE_CLOUD_WORKSPACE_ID"), client_id=dg.EnvVar("AIRBYTE_CLOUD_CLIENT_ID"), client_secret=dg.EnvVar("AIRBYTE_CLOUD_CLIENT_SECRET"), ) @airbyte_assets( connection_id="airbyte_connection_id", name="airbyte_connection_name", group_name="airbyte_connection_name", workspace=airbyte_workspace, ) def airbyte_connection_assets(context: dg.AssetExecutionContext, airbyte: AirbyteCloudWorkspace): yield from airbyte.sync_and_poll(context=context) defs = dg.Definitions( assets=[airbyte_connection_assets], resources={"airbyte": airbyte_workspace}, ) ``` ## How I Tested These Changes Additional tests with BK ## Changelog [dagster-airbyte] Airbyte Cloud assets can now be materialized using the `AirbyteCloudWorkspace.sync_and_poll(…)` method in the definition of a `@airbyte_assets` decorator.
- Loading branch information
1 parent
8825029
commit 5ee51b7
Showing
10 changed files
with
357 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.