Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - remove_file - 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 on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
17.20
Publication Date
November 2022
Content Type
Programming Reference
Publication ID
B700-4500-112K
ft:locale
en-US
ft:lastEdition
2024-02-21
ft:sourceId
FTML
dita:id
TeradataPython_FxRef_Lake_1720
Product Category
Teradata Vantage
teradataml.scriptmgmt.UserEnv.UserEnv.remove_file = remove_file(self, file_name, **kwargs)
DESCRIPTION:
    Function removes the specified file from the remote user environment.
 
PARAMETERS:
    file_name:
        Required Argument.
        Specifies the file name to be removed. If the file has an extension, specify the filename with extension.
        Types: str
 
**kwargs:
    Specifies the keyword arguments.
        suppress_output:
            Optional Argument.
            Specifies whether to print the output message or not.
            When set to True, then the output message is not printed.
            Types: bool
 
RETURNS:
    True, if the operation is successful.
 
RAISES:
    TeradataMlException, RuntimeError
 
EXAMPLES:
    # Create a Python 3.7.3 environment with given name and description in Vantage.
    >>> env = create_env('testenv', 'python_3.7.9', 'Test environment')
    User environment 'testenv' created.
 
    # Install the file "mapper.py" using the default text mode in the remote user 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 'testenv'.
 
    # Example 1: Remove file from remote user environment.
    >>> env.remove_file('mapper.py')
    File 'mapper.py' removed successfully from the remote user environment 'testenv'.
 
    # Remove the environment.
    >>> remove_env('testenv')
    User environment 'testenv' removed.