Hi, I want to know is there any way to get the las...
# dagster-plus
m
Hi, I want to know is there any way to get the last successful execution date ? I am writing an ETL which requires last execution date.
2
j
My recommendation would be to use the graphql api. For a job, I’d query the run history and grab the most recent successful one. For an asset, I’d query for the latest materialization
m
Can you share some sample code ?
j
Here’s some example gql
Copy code
query {
  assetNodes(
    assetKeys: [{ path: ["<your>", "<asset>"] }]
    loadMaterializations: true
  ) {
    assetMaterializations(limit:1) {
      timestamp
    }
  }
}
You can try that out in the graphql playground: https://runa.dagster.cloud/prod/graphql
And here’s the configuration to use it with the python client https://github.com/dagster-io/dagster/discussions/7772
m
Thank you
@Ricardo Da Silva
@Ricardo Da Silva