DagsterGraphQLClient(hostname, port_number=None, transport=None, use_https=False)¶
Official Dagster Python Client for GraphQL
Utilizes the gql library to dispatch queries over HTTP to a remote Dagster GraphQL Server
As of now, all operations on this client are synchronous.
client = DagsterGraphQLClient("localhost", port_number=3000) status = client.get_run_status(**SOME_RUN_ID**)
hostname (str) – Hostname for the Dagster GraphQL API, like localhost or dagit.dagster.YOUR_ORG_HERE.
port_number (Optional[int], optional) – Optional port number to connect to on the host. Defaults to None.
transport (Optional[Transport], optional) – A custom transport to use to connect to the GraphQL API with (e.g. for custom auth). Defaults to None.
use_https (bool, optional) – Whether to use https in the URL connection string for the GraphQL API. Defaults to False.
ConnectionError – if the client cannot connect to the host.
Get the status of a given Pipeline Run
run_id (str) – run id of the requested pipeline run.
returns a status Enum describing the state of the requested pipeline run
Reloads a Dagster Repository Location, which reloads all repositories in that repository location.
This is useful in a variety of contexts, including refreshing Dagit without restarting the server.
Shuts down the server that is serving metadata for the provided repository location.
This is primarily useful when you want the server to be restarted by the compute environment in which it is running (for example, in Kubernetes, the pod in which the server is running will automatically restart when the server is shut down, and the repository metadata will be reloaded)
repository_location_name (str) – The name of the repository location
Object with information about the result of the reload request
submit_pipeline_execution(pipeline_name, repository_location_name=None, repository_name=None, run_config=None, mode=None, preset=None, tags=None)¶
Submits a Pipeline with attached configuration for execution.
pipeline_name (str) – The pipeline’s name
repository_location_name (Optional[str], optional) – The name of the repository location where the pipeline is located. If omitted, the client will try to infer the repository location from the available options on the Dagster deployment. Defaults to None.
repository_name (Optional[str], optional) – The name of the repository where the pipeline is located. If omitted, the client will try to infer the repository from the available options on the Dagster deployment. Defaults to None.
run_config (Optional[Any], optional) – This is the run config to execute the pipeline with. Note that runConfigData is any-typed in the GraphQL type system. This type is used when passing in an arbitrary object for run config. However, it must conform to the constraints of the config schema for this pipeline. If it does not, the client will throw a DagsterGraphQLClientError with a message of PipelineConfigValidationInvalid. Defaults to None.
mode (Optional[str], optional) – The mode to run the pipeline with. If you have not defined any custom modes for your pipeline, the default mode is “default”. Defaults to None.
preset (Optional[str], optional) – The name of a pre-defined preset to use instead of a run config. Defaults to None.
tags (Optional[Dict[str, Any]], optional) – A set of tags to add to the pipeline execution.
DagsterGraphQLClientError("InvalidStepError", invalid_step_key) – the pipeline has an invalid step
DagsterGraphQLClientError("InvalidOutputError", body=error_object) – some solid has an invalid output within the pipeline. The error_object is of type dagster_graphql.InvalidOutputErrorInfo.
DagsterGraphQLClientError("ConflictingExecutionParamsError", invalid_step_key) – a preset and a run_config & mode are present that conflict with one another
DagsterGraphQLClientError("PresetNotFoundError", message) – if the provided preset name is not found
DagsterGraphQLClientError("PipelineRunConflict", message) – a DagsterRunConflict occured during execution. This indicates that a conflicting pipeline run already exists in run storage.
DagsterGraphQLClientError("PipelineConfigurationInvalid", invalid_step_key) – the run_config is not in the expected format for the pipeline
DagsterGraphQLClientError("PipelineNotFoundError", message) – the requested pipeline does not exist
DagsterGraphQLClientError("PythonError", message) – an internal framework error occurred
run id of the submitted pipeline run
This class gives information about an InvalidOutputError from submitting a pipeline for execution from GraphQL.
ReloadRepositoryLocationInfo(status, failure_type=None, message=None)¶
This class gives information about the result of reloading a Dagster repository location with a GraphQL mutation.
status (ReloadRepositoryLocationStatus) – The status of the reload repository location mutation
failure_type – (Optional[str], optional): the failure type if status == ReloadRepositoryLocationStatus.FAILURE. Can be one of ReloadNotSupported, RepositoryLocationNotFound, or RepositoryLocationLoadFailure. Defaults to None.
message (Optional[str], optional) – the failure message/reason if status == ReloadRepositoryLocationStatus.FAILURE. Defaults to None.