Teradata Package for Python Function Reference | 17.10 - copy_files_from_container - Teradata Package for Python
Teradata® Package for Python Function Reference
- Product
- Teradata Package for Python
- Release Number
- 17.10
- Published
- April 2022
- Language
- English (United States)
- Last Update
- 2022-08-19
- Product Category
- Teradata Vantage
- 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