Teradata Package for Python Function Reference on VantageCloud Lake - 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
- 20.00.00.03
- Published
- December 2024
- ft:locale
- en-US
- ft:lastEdition
- 2024-12-19
- dita:id
- TeradataPython_FxRef_Lake_2000
- 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.