Skip to content

Commit

Permalink
add pools to graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
prha committed Jan 21, 2025
1 parent eca2527 commit 529046e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.

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

6 changes: 6 additions & 0 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.

Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ class GrapheneAssetNode(graphene.ObjectType):
backfillPolicy = graphene.Field(GrapheneBackfillPolicy)
changedReasons = graphene.Field(non_null_list(GrapheneAssetChangedReason))
computeKind = graphene.String()
pools = non_null_list(graphene.String)
configField = graphene.Field(GrapheneConfigTypeField)
dataVersion = graphene.Field(graphene.String(), partition=graphene.String())
dataVersionByPartition = graphene.Field(
Expand Down Expand Up @@ -288,6 +287,7 @@ class GrapheneAssetNode(graphene.ObjectType):
startIdx=graphene.Int(),
endIdx=graphene.Int(),
)
pools = non_null_list(graphene.String)
repository = graphene.NonNull(lambda: external.GrapheneRepository)
required_resources = non_null_list(GrapheneResourceRequirement)
staleStatus = graphene.Field(GrapheneAssetStaleStatus, partition=graphene.String())
Expand Down Expand Up @@ -681,9 +681,6 @@ def _get_config_type(key: str):
field_snap=node_def_snap.config_field_snap,
)

def resolve_pools(self, _graphene_info: ResolveInfo) -> Sequence[str]:
return sorted([pool for pool in self._asset_node_snap.pools or set()])

def resolve_computeKind(self, _graphene_info: ResolveInfo) -> Optional[str]:
return self._asset_node_snap.compute_kind

Expand Down Expand Up @@ -1219,6 +1216,9 @@ def resolve_partitionDefinition(
return GraphenePartitionDefinition(partitions_snap)
return None

def resolve_pools(self, _graphene_info: ResolveInfo) -> Sequence[str]:
return sorted([pool for pool in self._asset_node_snap.pools or set()])

def resolve_repository(self, graphene_info: ResolveInfo) -> "GrapheneRepository":
return external.GrapheneRepository(self._repository_handle)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ class GrapheneISolidDefinition(graphene.Interface):
input_definitions = non_null_list(GrapheneInputDefinition)
output_definitions = non_null_list(GrapheneOutputDefinition)
assetNodes = non_null_list("dagster_graphql.schema.asset_graph.GrapheneAssetNode")
pools = non_null_list(graphene.String)

class Meta:
name = "ISolidDefinition"
Expand Down Expand Up @@ -454,6 +455,13 @@ def resolve_assetNodes(self, graphene_info: ResolveInfo) -> Sequence["GrapheneAs
for remote_node in remote_nodes
]

def resolve_pools(self, _graphene_info) -> Sequence[str]:
if isinstance(self._solid_def_snap, OpDefSnap):
return [self._solid_def_snap.pool] if self._solid_def_snap.pool else []
if isinstance(self._solid_def_snap, GraphDefSnap):
return list(self._solid_def_snap.pools)
return []


class GrapheneSolidDefinition(graphene.ObjectType, ISolidDefinitionMixin):
config_field = graphene.Field(GrapheneConfigTypeField)
Expand Down

0 comments on commit 529046e

Please sign in to comment.