Hi guys, is there a way to check whether an asset key exists? Thx
:dagster-bot-responded-by-community: 1
j
jamie
05/16/2023, 8:47 PM
@Yuan Cheng are you trying to write an asset that checks if another asset key exists? or do you want to make sure you don’t reuse a name when writing a new asset?
y
Yuan Cheng
05/16/2023, 8:55 PM
Hi @jamie, we are trying to use AssetSelection to select different assets depend on development environment, and if assets not exist then select all.
a
Adam Ward
05/16/2023, 9:25 PM
@Yuan Cheng - I believe you should be able to use
context.instance.all_asset_keys()
from within a asset or op (which should have the OpExecutionContext type).