Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dagster-airlift] refactor run execution params #25088

Open
wants to merge 1 commit into
base: dpeng817/factor_out_gql
Choose a base branch
from

Conversation

dpeng817
Copy link
Contributor

@dpeng817 dpeng817 commented Oct 4, 2024

Summary & Motivation

Factor out run execution parameterization + run tags

How I Tested These Changes

existing

Changelog

NOCHANGELOG

Copy link
Contributor Author

dpeng817 commented Oct 4, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @dpeng817 and the rest of your teammates on Graphite Graphite

Comment on lines +122 to +134
def get_attribute_from_airflow_context(self, context: Context, attribute: str) -> Any:
if attribute not in context or context[attribute] is None:
raise Exception(f"Attribute {attribute} not found in context.")
return context[attribute]

def get_airflow_dag_run_id(self, context: Context) -> str:
return self.get_attribute_from_airflow_context(context, "dag_run").run_id

def get_airflow_dag_id(self, context: Context) -> str:
return self.get_attribute_from_airflow_context(context, "dag_run").dag_id

def get_airflow_task_id(self, context: Context) -> str:
return self.get_attribute_from_airflow_context(context, "task").task_id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to constrast from the previous PR, get is appropriate here since it is in-memory/cheap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants