Retrieve last row
- async AsyncCogniteClient.sequences.data.retrieve_last_row(
- id: int | None = None,
- external_id: str | None = None,
- columns: SequenceNotStr[str] | None = None,
- before: int | None = None,
Retrieves the last row (i.e the row with the highest row number) in a sequence.
- Parameters:
id (int | None) – Id or list of ids.
external_id (str | None) – External id or list of external ids.
columns (SequenceNotStr[str] | None) – List of external id for the columns of the sequence. If ‘None’ is passed, all columns will be retrieved.
before (int | None) – (optional, int): Get latest datapoint before this row number.
- Returns:
A Datapoints object containing the requested data, or a list of such objects.
- Return type:
Examples
Getting the latest row in a sequence before row number 1000:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> res = client.sequences.data.retrieve_last_row(id=1, before=1000)