Skip to content

Commit

Permalink
thread pool information to graphql layer (#26802)
Browse files Browse the repository at this point in the history
## Summary & Motivation
Adds a pools graphql field for ops and assets

## How I Tested These Changes
BK
  • Loading branch information
prha authored Jan 21, 2025
1 parent 304ff63 commit 43cddb1
Show file tree
Hide file tree
Showing 9 changed files with 840 additions and 317 deletions.

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

10 changes: 10 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 @@ -287,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 @@ -1215,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
12 changes: 12 additions & 0 deletions python_modules/dagster-graphql/dagster_graphql/schema/solids.py
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,10 +455,18 @@ 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)
required_resources = non_null_list(GrapheneResourceRequirement)
pool = graphene.String()

class Meta:
interfaces = (GrapheneISolidDefinition,)
Expand Down Expand Up @@ -491,6 +500,9 @@ def resolve_required_resources(
GrapheneResourceRequirement(key) for key in self._solid_def_snap.required_resource_keys
]

def resolve_pool(self, _graphene_info: ResolveInfo) -> Optional[str]:
return self._solid_def_snap.pool


class GrapheneSolidStepStatsUnavailableError(graphene.ObjectType):
class Meta:
Expand Down
Loading

1 comment on commit 43cddb1

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-r6n35mb21-elementl.vercel.app

Built with commit 43cddb1.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.