Accessing the "Last Synchronized" of a Table using Python SDK and GQL

Original Slack Thread

Hi team i need help to access the “Last Synchronized” of a table using python SDK, does anyone know how to do that?attachment

Hi
Your MCPW must have systemMetadata specified with last observed and runId fields
a sample below

        entityType="dataset",
        changeType=ChangeTypeClass.UPSERT,
        entityUrn=<urn>,
		aspectName="status",
		aspect=StatusClass(removed=False),
        systemMetadata=SystemMetadataClass(
        lastObserved=1751516640321, 
        runId="<provide_a_run_id>")
    )```

But is this for change the value of the lastObserved, isn’t?
Because actually I want to access the information, to see when was the last synchronized on a specific dataset.

Sorry but I’m just starting to use DataHub, I do not understand much.

Sorry, I thought you wanted to update ’“Last Synchronized”, I misread your message
You want access/read “Last Synchronized”, it must be possible with SDK or GQL let me check for an example

it is lastIngested field in GQL
for a dataset

  dataset(urn: "<dataset_urn>") {
    exists
     urn
  name
  type
  uri
  lastIngested
  }
}```

Thank you, I will try here to use the GQL, I was using just Python SDK, but just know that the information that I want is in the lastIngested field helped a lot. Thank you again.