Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Oct 14, 2024
1 parent 680b7b1 commit 967b8d8
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 65 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 36 additions & 31 deletions js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 39 additions & 13 deletions python_modules/dagster-graphql/dagster_graphql/schema/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,23 +532,49 @@ def resolve_launchedBy(self, _graphene_info: ResolveInfo):
deetermined based on the tags of the backfill, not the source of the backfill as stored in the DB. Thus, some
backfills may have different launchedBy values from source columns.
"""
if self.tags.get(USER_TAG):
return GrapheneLaunchedBy(kind="user", value=self.tags[USER_TAG])
if self.tags.get(SCHEDULE_NAME_TAG):
return GrapheneLaunchedBy(kind="schedule", value=self.tags[SCHEDULE_NAME_TAG])
if self.tags.get(SENSOR_NAME_TAG):
return GrapheneLaunchedBy(kind="sensor", value=self.tags[SENSOR_NAME_TAG])
if self.tage.get(AUTO_MATERIALIZE_TAG):
from dagster_graphql.schema.tags import GraphenePipelineTag

if self._backfill_job.tags.get(USER_TAG):
return GrapheneLaunchedBy(
kind="user",
tag=GraphenePipelineTag(key=USER_TAG, value=self._backfill_job.tags[USER_TAG]),
)
if self._backfill_job.tags.get(SCHEDULE_NAME_TAG):
return GrapheneLaunchedBy(
kind="auto-materialize", value=self.tags[AUTO_MATERIALIZE_TAG]
kind="schedule",
tag=GraphenePipelineTag(
key=SCHEDULE_NAME_TAG, value=self._backfill_job.tags[SCHEDULE_NAME_TAG]
),
)
if self._backfill_job.tags.get(SENSOR_NAME_TAG):
return GrapheneLaunchedBy(
kind="sensor",
tag=GraphenePipelineTag(
key=SENSOR_NAME_TAG, value=self._backfill_job.tags[SENSOR_NAME_TAG]
),
)
if self.tags.get("dagster/created_by") == "auto_materialize":
if self._backfill_job.tags.get(AUTO_MATERIALIZE_TAG):
return GrapheneLaunchedBy(
kind="auto-materialize", value=self.tags["dagster/created_by"]
kind="auto-materialize",
tag=GraphenePipelineTag(
key=AUTO_MATERIALIZE_TAG, value=self._backfill_job.tags[AUTO_MATERIALIZE_TAG]
),
)
if self._backfill_job.tags.get("dagster/created_by") == "auto_materialize":
return GrapheneLaunchedBy(
kind="auto-materialize",
tag=GraphenePipelineTag(
key="dagster/created_by", value=self._backfill_job.tags["dagster/created_by"]
),
)
if self._backfill_job.tags.get(AUTO_OBSERVE_TAG):
return GrapheneLaunchedBy(
kind="auto-observe",
tag=GraphenePipelineTag(
key=AUTO_OBSERVE_TAG, value=self._backfill_job.tags[AUTO_OBSERVE_TAG]
),
)
if self.tags.get(AUTO_OBSERVE_TAG):
return GrapheneLaunchedBy(kind="auto-observe", value=self.tags[AUTO_OBSERVE_TAG])
return GrapheneLaunchedBy(kind="manual", value="")
return GrapheneLaunchedBy(kind="manual", tag=GraphenePipelineTag(key="", value=""))

def resolve_runStatus(self, _graphene_info: ResolveInfo) -> GrapheneRunStatus:
return GrapheneBulkActionStatus(self.status).to_dagster_run_status()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import graphene

from dagster_graphql.schema.tags import GraphenePipelineTag


class GrapheneLaunchedBy(graphene.ObjectType):
kind = graphene.NonNull(graphene.String)
value = graphene.NonNull(graphene.String)
tag = graphene.NonNull(GraphenePipelineTag)

class Meta:
name = "LaunchedBy"

def __init__(self, kind: str, value: str):
def __init__(self, kind: str, tag):
self.kind = kind
self.value = value
self.tag = tag
Original file line number Diff line number Diff line change
Expand Up @@ -546,23 +546,47 @@ def resolve_launchedBy(self, _graphene_info: ResolveInfo):
deetermined based on the tags of the run, not the source of the run as stored in the DB. Thus, some
runs may have different launchedBy values from source columns.
"""
if self.tags.get(USER_TAG):
return GrapheneLaunchedBy(kind="user", value=self.tags[USER_TAG])
if self.tags.get(SCHEDULE_NAME_TAG):
return GrapheneLaunchedBy(kind="schedule", value=self.tags[SCHEDULE_NAME_TAG])
if self.tags.get(SENSOR_NAME_TAG):
return GrapheneLaunchedBy(kind="sensor", value=self.tags[SENSOR_NAME_TAG])
if self.tage.get(AUTO_MATERIALIZE_TAG):
if self.dagster_run.tags.get(USER_TAG):
return GrapheneLaunchedBy(
kind="auto-materialize", value=self.tags[AUTO_MATERIALIZE_TAG]
kind="user",
tag=GraphenePipelineTag(key=USER_TAG, value=self.dagster_run.tags[USER_TAG]),
)
if self.tags.get("dagster/created_by") == "auto_materialize":
if self.dagster_run.tags.get(SCHEDULE_NAME_TAG):
return GrapheneLaunchedBy(
kind="auto-materialize", value=self.tags["dagster/created_by"]
kind="schedule",
tag=GraphenePipelineTag(
key=SCHEDULE_NAME_TAG, value=self.dagster_run.tags[SCHEDULE_NAME_TAG]
),
)
if self.tags.get(AUTO_OBSERVE_TAG):
return GrapheneLaunchedBy(kind="auto-observe", value=self.tags[AUTO_OBSERVE_TAG])
return GrapheneLaunchedBy(kind="manual", value="")
if self.dagster_run.tags.get(SENSOR_NAME_TAG):
return GrapheneLaunchedBy(
kind="sensor",
tag=GraphenePipelineTag(
key=SENSOR_NAME_TAG, value=self.dagster_run.tags[SENSOR_NAME_TAG]
),
)
if self.dagster_run.tags.get(AUTO_MATERIALIZE_TAG):
return GrapheneLaunchedBy(
kind="auto-materialize",
tag=GraphenePipelineTag(
key=AUTO_MATERIALIZE_TAG, value=self.dagster_run.tags[AUTO_MATERIALIZE_TAG]
),
)
if self.dagster_run.tags.get("dagster/created_by") == "auto_materialize":
return GrapheneLaunchedBy(
kind="auto-materialize",
tag=GraphenePipelineTag(
key="dagster/created_by", value=self.dagster_run.tags["dagster/created_by"]
),
)
if self.dagster_run.tags.get(AUTO_OBSERVE_TAG):
return GrapheneLaunchedBy(
kind="auto-observe",
tag=GraphenePipelineTag(
key=AUTO_OBSERVE_TAG, value=self.dagster_run.tags[AUTO_OBSERVE_TAG]
),
)
return GrapheneLaunchedBy(kind="manual", tag=GraphenePipelineTag(key="", value=""))

def resolve_rootRunId(self, _graphene_info: ResolveInfo):
return self.dagster_run.root_run_id
Expand Down

0 comments on commit 967b8d8

Please sign in to comment.