-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: dpeng817/factor_out_gql
Are you sure you want to change the base?
Conversation
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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 |
There was a problem hiding this comment.
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
Summary & Motivation
Factor out run execution parameterization + run tags
How I Tested These Changes
existing
Changelog
NOCHANGELOG