Teradata Package for Python Function Reference | 20.00 - get_snapshot - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference - 20.00

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Package for Python
Release Number
20.00.00.11
Published
August 2026
ft:locale
en-US
ft:lastEdition
2026-08-13
dita:id
TeradataPython_FxRef_Enterprise_2000
Product Category
Teradata Vantage
teradataml.dataframe.dataframe.DataFrame.get_snapshot = get_snapshot(self, as_of)
DESCRIPTION:
    Gets the data from a DataLake table for the given snapshot id or timestamp string.
    Notes:
        * The snapshot id can be obtained from the 'snapshots' property of the DataFrame.
        * The time travel value represented by 'as_of' should be in the format "YYYY-MM-DD HH:MM:SS.FFFFFFF"
          for TIMESTAMP string or "YYYY-MM-DD" for DATE string.
 
PARAMETERS:
    as_of:
        Required Argument.
        Specifies the snapshot id or timestamp information for which the snapshot is to be fetched.
        Types: str or int
 
RETURNS:
    teradataml DataFrame.
 
RAISES:
    TeradataMLException.
 
EXAMPLES:
    # DataFrame creation on OTF table.
    >>> from teradataml.dataframe.dataframe import in_schema
    >>> in_schema_tbl = in_schema(schema_name="datalake_db",
    ...                           table_name="datalake_table",
    ...                           datalake_name="datalake")
    >>> datalake_df = DataFrame(in_schema_tbl)
 
    # List snapshots first.
    >>> datalake_df.snapshots
                snapshotId        snapshotTimestamp      timestampMSecs                                      manifestList         summary
       2046682612111137809      2025-06-03 13:26:15       1748957175692  s3://vim-iceberg-v1/datalake_db/datalake_table/metadata/snap-204...    {"added-data-files":"Red Inc","added-records"...}
        282293708812257203      2025-06-03 05:53:19       1748929999245  s3://vim-iceberg-v1/datalake_db/datalake_table/metadata/snap-282...    {"added-data-files":"Blue Inc","added-records"...}
 
    # Example 1: Get the snapshot using snapshot id.
    >>> datalake_df.get_snapshot(2046682612111137809)
                  Feb    Jan    Mar    Apr    datetime
    accounts
    Blue Inc     90.0   50.0   95.0  101.0  04/01/2017
    Alpha Co    210.0  200.0  215.0  250.0  04/01/2017
    Jones LLC   200.0  150.0  140.0  180.0  04/01/2017
    Yellow Inc   90.0    NaN    NaN    NaN  04/01/2017
    Orange Inc  210.0    NaN    NaN  250.0  04/01/2017
    Red Inc     200.0  150.0  140.0    NaN  04/01/2017
 
    # Example 2: Get the snapshot using snapshot id in string format.
    >>> datalake_df.get_snapshot("2046682612111137809")
                  Feb    Jan    Mar    Apr    datetime
    accounts
    Blue Inc     90.0   50.0   95.0  101.0  04/01/2017
    Alpha Co    210.0  200.0  215.0  250.0  04/01/2017
    Jones LLC   200.0  150.0  140.0  180.0  04/01/2017
    Yellow Inc   90.0    NaN    NaN    NaN  04/01/2017
    Orange Inc  210.0    NaN    NaN  250.0  04/01/2017
    Red Inc     200.0  150.0  140.0    NaN  04/01/2017
 
    # Example 3: Get the snapshot using timestamp string.
    >>> datalake_df.get_snapshot("2025-06-03 13:26:16")
                  Feb    Jan    Mar    Apr    datetime
    accounts
    Blue Inc     90.0   50.0   95.0  101.0  04/01/2017
    Alpha Co    210.0  200.0  215.0  250.0  04/01/2017
    Jones LLC   200.0  150.0  140.0  180.0  04/01/2017
    Yellow Inc   90.0    NaN    NaN    NaN  04/01/2017
    Orange Inc  210.0    NaN    NaN  250.0  04/01/2017
    Red Inc     200.0  150.0  140.0    NaN  04/01/2017
 
    # Example 4: Get the snapshot using date string.
    >>> datalake_df.get_snapshot("2025-06-04")
                  Feb    Jan    Mar    Apr    datetime
    accounts
    Blue Inc     90.0   50.0   95.0  101.0  04/01/2017
    Alpha Co    210.0  200.0  215.0  250.0  04/01/2017
    Jones LLC   200.0  150.0  140.0  180.0  04/01/2017
    Yellow Inc   90.0    NaN    NaN    NaN  04/01/2017
    Orange Inc  210.0    NaN    NaN  250.0  04/01/2017
    Red Inc     200.0  150.0  140.0    NaN  04/01/2017