snapshot | Manage files and libs in User Environment | Open Analytics Framework - snapshot - Teradata VantageCloud Lake

Lake - Analyze Your Data with ClearScape Analytics™

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2026-02-20
dita:mapPath
tcl1683670667798.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
tcl1683670667798

Use the snapshot() function to take the snapshot of the user environment.

This function stores the snapshot of the user environment in a JSON file, which can be used as input to recreate the exact same user environment by passing the snapshot file to create_env.

Optional Argument

dir
Specifies the directory path to store the snapshot file.
If this argument is not provided, the function creates a temporary folder and store the snapshot file in the temp folder.
While taking the snapshot, if a file is installed in the environment, to recreate the exact same user environment, you have to provide the absolute path of the file to be installed in the generated snapshot file by replacing <ADD_YOUR_LOCAL_FILE_PATH> in the generated snapshot file.

Example

  • Create a Python environment with name"env_1" in Vantage.
    >>> env = create_env("env_1")
    ... User environment 'env_1' created.
  • Install the file mapper.py in the 'env_1' environment.
    >>> import os, teradataml
    >>> file_path = os.path.join(os.path.dirname(teradataml.__file__), "data", "scripts", "mapper.py")
    >>> env.install_file(file_path = file_path)
    File 'mapper.py' installed successfully in the remote user environment 'env_1'.
    True
  • Install 'numpy' Python library.
    >>> env.install_lib('numpy')
    fa72b8ec-429e-4a63-a6d1-598869a57bc3
                                   Claim Id File/Libs/Model  Method Name     Stage             Timestamp Additional Details
    0  fa72b8ec-429e-4a63-a6d1-598869a57bc3           numpy  install_lib   Started  2023-11-28T17:06:18Z
    1  fa72b8ec-429e-4a63-a6d1-598869a57bc3           numpy  install_lib  Finished  2023-11-28T17:06:39Z
  • Take a snapshot of 'env_1'.
    >>> env.snapshot()
    Snapshot for environment "env_1" is stored at "...:\\...\\...\\snapshot_env_1_python_3.10.5_1700740261.2757893.json"