Teradata Package for Python Function Reference on VantageCloud Lake - list_td_reserved_keywords - 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.02
- Published
- September 2024
- Language
- English (United States)
- Last Update
- 2024-10-17
- dita:id
- TeradataPython_FxRef_Lake_2000
- Product Category
- Teradata Vantage
- teradataml.dbutils.dbutils.list_td_reserved_keywords = list_td_reserved_keywords(key=None, raise_error=False)
- DESCRIPTION:
Function validates if the specified string or the list of strings is Teradata reserved keyword or not.
If key is not specified or is a empty list, list all the Teradata reserved keywords.
PARAMETERS:
key:
Optional Argument.
Specifies a string or list of strings to validate for Teradata reserved keyword.
Types: string or list of strings
raise_error:
Optional Argument.
Specifies whether to raise exception or not.
When set to True, an exception is raised,
if specified "key" contains Teradata reserved keyword, otherwise not.
Default Value: False
Types: bool
RETURNS:
teradataml DataFrame, if "key" is None or a empty list.
True, if "key" contains Teradata reserved keyword, False otherwise.
RAISES:
TeradataMlException.
EXAMPLES:
>>> from teradataml import list_td_reserved_keywords
>>> # Example 1: List all available Teradata reserved keywords.
>>> list_td_reserved_keywords()
restricted_word
0 ABS
1 ACCOUNT
2 ACOS
3 ACOSH
4 ADD_MONTHS
5 ADMIN
6 ADD
7 ACCESS_LOCK
8 ABORTSESSION
9 ABORT
>>>
>>> # Example 2: Validate if keyword "account" is a Teradata reserved keyword or not.
>>> list_td_reserved_keywords("account")
True
>>>
>>> # Example 3: Validate and raise exception if keyword "account" is a Teradata reserved keyword.
>>> list_td_reserved_keywords("account", raise_error=True)
TeradataMlException: [Teradata][teradataml](TDML_2121) '['ACCOUNT']' is a Teradata reserved keyword.
>>> # Example 4: Validate if the list of keywords contains Teradata reserved keyword or not.
>>> list_td_reserved_keywords(["account", 'add', 'abc'])
True
>>> # Example 5: Validate and raise exception if the list of keywords contains Teradata reserved keyword.
>>> list_td_reserved_keywords(["account", 'add', 'abc'], raise_error=True)
TeradataMlException: [Teradata][teradataml](TDML_2121) '['ADD', 'ACCOUNT']' is a Teradata reserved keyword.