Teradata Package for Python Function Reference - 17.00 - copy_files_from_container - Teradata Package for Python

Teradata® Package for Python Function Reference

Product
Teradata Package for Python
Release Number
17.00
Release Date
April 2021
Content Type
Programming Reference
Publication ID
B700-4008-070K
Language
English (United States)
teradataml.table_operators.sandbox_container_util.copy_files_from_container = copy_files_from_container(files_to_copy, container_id=None)
DESCRIPTION:
    Function to copy file(s) from container specified by "container_id" or container
    indicated by 'configure.sandbox_container_id' to local filesystem.
    Notes:
        1. Files will be copied to a directory in .teradataml directory under
           user's home directory.
        2. User is responsible for cleaning up this directory.
 
PARAMETERS:
    files_to_copy:
        Required Argument.
        Specifies the filename(s) to be copied from container.
        Type: str OR list of Strings (str)
        Note:
            Files should be in "/home/tdatuser" inside the container.
 
    container_id:
        Optional Argument.
        Specifies the container from which files are to be copied.
        If not specified, then files are copied from container in
        'configure.sandbox_container_id'.
        Types: str
 
RETURNS:
    None.
 
RAISES:
    docker.errors.APIError, TeradataMlException, Exception.
 
EXAMPLES:
    # Copy files from "/home/tdatuser" inside container started by teradataml to
    local host.
    >>> from teradataml.table_operators.sandbox_container_util
    import copy_files_from_container
 
    >>> copy_files_from_container(files_to_copy="file1.txt")
    Files copied to: /<user's home directory>/.teradataml/files_from_container_210110_193943
 
    >>> copy_files_from_container(files_to_copy=["output/file1.txt", "file2.txt"])
    Files copied to: /<user's home directory>/.teradataml/files_from_container_210110_193943