You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to test assets that connect to a local docker network
materialize() executes the asset in a subprocess even if the instance that is passed in specifies a different executor
thus, it requires me to change the hostname; I have a lot of services so would prefer to keep everything in the docker network as well for encapsulation
My test looks generally like this. The test otherwise works fine and I like the API, I just wat to use the executor I would use in production, namely the Docker one.
Example Test I want to use it in
assets=load_assets_from_modules([main])
# It is possible to load certain asset types that cannot be passed into# Materialize so we filter them to avoid a pyright type errorfiltered_assets= [
assetforassetinassetsifisinstance(asset, (AssetsDefinition, AssetSpec, SourceAsset))
]
# These three assets are needed to generate the dynamic partition.result=materialize(
assets=filtered_assets,
selection=["upstream_Data", "config", "docker_client_environment"],
instance=instance,
)
assertresult.success
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
materialize()
executes the asset in a subprocess even if the instance that is passed in specifies a different executorI don't see this specified in the docs.
https://docs.dagster.io/guides/test/unit-testing-assets-and-ops
Is there a way to accomplish this?
My test looks generally like this. The test otherwise works fine and I like the API, I just wat to use the executor I would use in production, namely the Docker one.
Example Test I want to use it in
Beta Was this translation helpful? Give feedback.
All reactions