Skip to content

Commit

Permalink
[dagster-fivetran] Remove OpExecutionContext support in FivetranWorks…
Browse files Browse the repository at this point in the history
…pace.sync_and_poll (#26585)

## Summary & Motivation

Following [this
discussion](#26432 (comment))
for Airbyte Cloud - `FivetranWorkspace.sync_and_poll` should only accept
context of type `AssetExecutionContext`.

## How I Tested These Changes

Same tests with BK
  • Loading branch information
maximearmstrong authored Dec 20, 2024
1 parent c78baa1 commit 32e5be0
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
InitResourceContext,
MaterializeResult,
MetadataValue,
OpExecutionContext,
__version__,
_check as check,
get_dagster_logger,
Expand Down Expand Up @@ -1014,14 +1013,14 @@ def _generate_materialization(
)

def sync_and_poll(
self, context: Union[OpExecutionContext, AssetExecutionContext]
self, context: AssetExecutionContext
) -> FivetranEventIterator[Union[AssetMaterialization, MaterializeResult]]:
"""Executes a sync and poll process to materialize Fivetran assets.
This method can only be used in the context of an asset execution.
Args:
context (Union[OpExecutionContext, AssetExecutionContext]): The execution context
from within `@fivetran_assets`. If an AssetExecutionContext is passed,
its underlying OpExecutionContext will be used.
context (AssetExecutionContext): The execution context
from within `@fivetran_assets`.
Returns:
Iterator[Union[AssetMaterialization, MaterializeResult]]: An iterator of MaterializeResult
Expand All @@ -1031,7 +1030,7 @@ def sync_and_poll(
events=self._sync_and_poll(context=context), fivetran_workspace=self, context=context
)

def _sync_and_poll(self, context: Union[OpExecutionContext, AssetExecutionContext]):
def _sync_and_poll(self, context: AssetExecutionContext):
assets_def = context.assets_def
dagster_fivetran_translator = get_translator_from_fivetran_assets(assets_def)
connector_id = next(
Expand Down

0 comments on commit 32e5be0

Please sign in to comment.