Skip to content

How to get the code location of a given asset? #18192

Answered by benpankow
dagsir[bot] bot asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, it's possible to extract from the asset context:

@asset
def my_asset(context: AssetExecutionContext):
  location_name = (context.get_step_execution_context()
    .dagster_run.remote_job_origin.external_repository_origin
    .code_location_origin.location_name)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Rhiyo
Comment options

@maximearmstrong
Comment options

Answer selected by benpankow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants