This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query InstigationStateQuery { | |
instigationStateOrError(instigationSelector: { | |
repositoryName: "__repository__", | |
repositoryLocationName: "data-eng-pipeline", | |
name: "orders_sensor" | |
}) { | |
__typename | |
... on InstigationState { | |
id | |
status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query RunsBySensorAndStatus($filter: RunsFilter!) { | |
runsOrError(filter: $filter, limit: 1) { | |
__typename | |
... on Runs { | |
results { | |
runId | |
jobName | |
status | |
startTime | |
endTime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query GetDagsterCloudUsers { | |
usersOrError { | |
... on DagsterCloudUsersWithScopedPermissionGrants { | |
users { | |
id | |
user { | |
name | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note that: | |
- repositoryName = name of the Repository (if none, use "__repository__") | |
- repositoryLocationName = name of the Code Location | |
If the Code location name is something like "foo@bar" then this represents {repository}@{location} | |
i.e. the repository name is "foo" and location name is "bar". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from gql import Client, gql | |
from gql.transport.requests import RequestsHTTPTransport | |
url = "https://yourorg.dagster.cloud/prod/graphql" | |
token = os.getenv( | |
"DAGSTER_CLOUD_USER_TOKEN" | |
) # a User Token generated from the Cloud Settings page in Dagster Cloud. Note: User Token, not Agent Token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from databricks import sql | |
import os | |
# Retrieve environment variables | |
server_hostname = os.getenv("DATABRICKS_SERVER_HOSTNAME") | |
http_path = os.getenv("DATABRICKS_HTTP_PATH") | |
access_token = os.getenv("DATABRICKS_TOKEN") | |
# Establish a connection to the Databricks SQL warehouse | |
with sql.connect(server_hostname=server_hostname, http_path=http_path, access_token=access_token) as connection: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dagster import asset, Definitions, AssetExecutionContext | |
@asset | |
def upstream_asset(): | |
return "data produced by upstream_asset" | |
@asset() | |
def downstream_asset(context: AssetExecutionContext, upstream_asset: str): | |
context.log.info(f"processed {upstream_asset}") | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query RunQuery($runId: ID!) { | |
runOrError(runId: $runId) { | |
__typename | |
... on Run { | |
id | |
status | |
startTime | |
endTime | |
stepStats { | |
stepKey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from gql import Client, gql | |
from gql.transport.requests import RequestsHTTPTransport | |
# Define the endpoint URL and token | |
org_name = "your_org_name" | |
base_url = f"https://{org_name}.dagster.cloud/" | |
deployment_name = "your_deployment_name" # branch deployments use an ID | |
url = base_url + deployment_name + "/graphql" | |
token = os.getenv("DAGSTER_CLOUD_USER_TOKEN") # a User Token generated from the Organization settings page in Dagster+. Note: User Token, not Agent Token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query AssetQuery($assetKeys: [AssetKeyInput!]!) { | |
assetNodes(assetKeys: $assetKeys) { | |
id | |
assetKey { | |
path | |
} | |
groupName | |
} | |
} |
OlderNewer