Teradata Package for Python Function Reference | 17.10 - 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

Product
Teradata Package for Python
Release Number
17.10
Published
April 2022
Language
English (United States)
Last Update
2022-08-19
lifecycle
previous
Product Category
Teradata Vantage
teradataml.dbutils.filemgr.remove_file = remove_file(file_identifier, force_remove=False, suppress_output=False)
DESCRIPTION:
    Function to remove user installed files/scripts from Vantage.
 
PARAMETERS:
    file_identifier:
        Required Argument.
        Specifies the name associated with the user-installed file.
        It cannot have a database name associated with it,
        as the file is always installed in the current database.
        Types: str
 
    force_remove:
        Required Argument.
        Specifies if system should check for the file being used before removing it.
        If set to True, then the file is removed even if it is being executed.
        If set to False, then an error is thrown if it is being executed.
        Default Value: False
        Types: bool
 
    suppress_output:
        Optional Argument.
        Specifies whether to print the output message or not.
        If set to True, then the output message is not printed.
        Default Value: False
        Types: bool
 
RETURNS:
     True, if success.
 
RAISES:
    TeradataMLException.
 
EXAMPLES:
    # Run install_file example before removing file.
    # Note: File can be on client or remote server. The file location should be specified accordingly.
    # Example 1: Install the file mapper.py found at the relative path data/scripts/ using the default
    #            text mode.
    >>> install_file (file_identifier='mapper', file_path='data/scripts/mapper.py')
    File mapper.py installed in Vantage
 
    # Example 2: Install the file binary_file.dms found at the relative path data/scripts/
    #            using the binary mode.
    >>> install_file (file_identifier='binaryfile', file_path='data/scripts/binary_file.dms', file_on_client = True, is_binary = True)
    File binary_file.dms installed in Vantage
 
    # Remove the installed files.
    # Example 1: Remove text file
    >>> remove_file (file_identifier='mapper', force_remove=True)
    File mapper removed from Vantage
 
    # Example 2: Remove binary file
    >>> remove_file (file_identifier='binaryfile', force_remove=False)
    File binaryfile removed from Vantage