teradataml 20.0.0.6__py3-none-any.whl → 20.0.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of teradataml might be problematic. Click here for more details.
- teradataml/README.md +210 -0
- teradataml/__init__.py +1 -1
- teradataml/_version.py +1 -1
- teradataml/analytics/analytic_function_executor.py +162 -76
- teradataml/analytics/byom/__init__.py +1 -1
- teradataml/analytics/json_parser/__init__.py +2 -0
- teradataml/analytics/json_parser/analytic_functions_argument.py +95 -2
- teradataml/analytics/json_parser/metadata.py +22 -4
- teradataml/analytics/sqle/DecisionTreePredict.py +3 -2
- teradataml/analytics/sqle/NaiveBayesPredict.py +3 -2
- teradataml/analytics/sqle/__init__.py +3 -0
- teradataml/analytics/utils.py +4 -1
- teradataml/automl/__init__.py +2369 -464
- teradataml/automl/autodataprep/__init__.py +15 -0
- teradataml/automl/custom_json_utils.py +184 -112
- teradataml/automl/data_preparation.py +113 -58
- teradataml/automl/data_transformation.py +154 -53
- teradataml/automl/feature_engineering.py +113 -53
- teradataml/automl/feature_exploration.py +548 -25
- teradataml/automl/model_evaluation.py +260 -32
- teradataml/automl/model_training.py +399 -206
- teradataml/clients/auth_client.py +2 -2
- teradataml/common/aed_utils.py +11 -2
- teradataml/common/bulk_exposed_utils.py +4 -2
- teradataml/common/constants.py +62 -2
- teradataml/common/garbagecollector.py +50 -21
- teradataml/common/messagecodes.py +47 -2
- teradataml/common/messages.py +19 -1
- teradataml/common/sqlbundle.py +23 -6
- teradataml/common/utils.py +116 -10
- teradataml/context/aed_context.py +16 -10
- teradataml/data/Employee.csv +5 -0
- teradataml/data/Employee_Address.csv +4 -0
- teradataml/data/Employee_roles.csv +5 -0
- teradataml/data/JulesBelvezeDummyData.csv +100 -0
- teradataml/data/byom_example.json +5 -0
- teradataml/data/creditcard_data.csv +284618 -0
- teradataml/data/docs/byom/docs/ONNXSeq2Seq.py +255 -0
- teradataml/data/docs/sqle/docs_17_10/NGramSplitter.py +1 -1
- teradataml/data/docs/sqle/docs_17_20/NGramSplitter.py +1 -1
- teradataml/data/docs/sqle/docs_17_20/TextParser.py +1 -1
- teradataml/data/jsons/byom/ONNXSeq2Seq.json +287 -0
- teradataml/data/jsons/sqle/20.00/AI_AnalyzeSentiment.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_AskLLM.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_DetectLanguage.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_ExtractKeyPhrases.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_MaskPII.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_RecognizeEntities.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_RecognizePIIEntities.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_TextClassifier.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_TextEmbeddings.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_TextSummarize.json +3 -7
- teradataml/data/jsons/sqle/20.00/AI_TextTranslate.json +3 -7
- teradataml/data/jsons/sqle/20.00/TD_API_AzureML.json +151 -0
- teradataml/data/jsons/sqle/20.00/TD_API_Sagemaker.json +182 -0
- teradataml/data/jsons/sqle/20.00/TD_API_VertexAI.json +183 -0
- teradataml/data/load_example_data.py +29 -11
- teradataml/data/payment_fraud_dataset.csv +10001 -0
- teradataml/data/teradataml_example.json +67 -0
- teradataml/dataframe/copy_to.py +714 -54
- teradataml/dataframe/dataframe.py +1153 -33
- teradataml/dataframe/dataframe_utils.py +8 -3
- teradataml/dataframe/functions.py +168 -1
- teradataml/dataframe/setop.py +4 -1
- teradataml/dataframe/sql.py +141 -9
- teradataml/dbutils/dbutils.py +470 -35
- teradataml/dbutils/filemgr.py +1 -1
- teradataml/hyperparameter_tuner/optimizer.py +456 -142
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/lib/libaed_0_1.dylib +0 -0
- teradataml/lib/libaed_0_1.so +0 -0
- teradataml/lib/libaed_0_1_aarch64.so +0 -0
- teradataml/scriptmgmt/UserEnv.py +234 -34
- teradataml/scriptmgmt/lls_utils.py +43 -17
- teradataml/sdk/_json_parser.py +1 -1
- teradataml/sdk/api_client.py +9 -6
- teradataml/sdk/modelops/_client.py +3 -0
- teradataml/series/series.py +12 -7
- teradataml/store/feature_store/constants.py +601 -234
- teradataml/store/feature_store/feature_store.py +2886 -616
- teradataml/store/feature_store/mind_map.py +639 -0
- teradataml/store/feature_store/models.py +5831 -214
- teradataml/store/feature_store/utils.py +390 -0
- teradataml/table_operators/table_operator_util.py +1 -1
- teradataml/table_operators/templates/dataframe_register.template +6 -2
- teradataml/table_operators/templates/dataframe_udf.template +6 -2
- teradataml/utils/docstring.py +527 -0
- teradataml/utils/dtypes.py +93 -0
- teradataml/utils/internal_buffer.py +2 -2
- teradataml/utils/utils.py +41 -2
- teradataml/utils/validators.py +694 -17
- {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/METADATA +213 -2
- {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/RECORD +96 -81
- {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/WHEEL +0 -0
- {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/top_level.txt +0 -0
- {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/zip-safe +0 -0
teradataml/utils/utils.py
CHANGED
|
@@ -17,6 +17,8 @@ from teradataml.common.exceptions import TeradataMlException
|
|
|
17
17
|
from teradataml.common.messages import Messages, MessageCodes
|
|
18
18
|
from teradataml.common.constants import AsyncStatusColumns
|
|
19
19
|
from teradataml.utils.validators import _Validators
|
|
20
|
+
from teradatasql import OperationalError
|
|
21
|
+
from teradataml.utils.dtypes import _ListOf
|
|
20
22
|
|
|
21
23
|
# TODO: Add an option to set concurrency.
|
|
22
24
|
_td_th_executor = ThreadPoolExecutor(max_workers=4)
|
|
@@ -24,7 +26,7 @@ _td_th_executor = ThreadPoolExecutor(max_workers=4)
|
|
|
24
26
|
_async_run_id_info = {}
|
|
25
27
|
|
|
26
28
|
|
|
27
|
-
def execute_sql(statement, parameters=None):
|
|
29
|
+
def execute_sql(statement, parameters=None, ignore_errors=None):
|
|
28
30
|
"""
|
|
29
31
|
DESCRIPTION:
|
|
30
32
|
Executes the SQL statement by using provided parameters.
|
|
@@ -42,6 +44,17 @@ def execute_sql(statement, parameters=None):
|
|
|
42
44
|
Specifies parameters to be used in case of parameterized query.
|
|
43
45
|
Types: list of list, list of tuple
|
|
44
46
|
|
|
47
|
+
ignore_errors:
|
|
48
|
+
Optional Argument.
|
|
49
|
+
Specifies the error code(s) to ignore while running the statement.
|
|
50
|
+
Note:
|
|
51
|
+
* Error code(s) are Teradata Vantage error codes. Not teradataml
|
|
52
|
+
error codes.
|
|
53
|
+
* All errors can be ignored by setting "ignore_errors" to 'all'.
|
|
54
|
+
Permitted Values:
|
|
55
|
+
* all - Ignore all the errors during execution.
|
|
56
|
+
Types: str, int or list of int
|
|
57
|
+
|
|
45
58
|
RETURNS:
|
|
46
59
|
Cursor object.
|
|
47
60
|
|
|
@@ -68,19 +81,45 @@ def execute_sql(statement, parameters=None):
|
|
|
68
81
|
# Example 3: Run Help Column query on table.
|
|
69
82
|
result_cursor = execute_sql('Help column table1.*;')
|
|
70
83
|
|
|
84
|
+
# Example 4: Create table 'Table_xyz' with one column of type integer.
|
|
85
|
+
# Ignore the error if table already exists.
|
|
86
|
+
# Note: Teradata error code while creating duplicate table is 3804.
|
|
87
|
+
result = execute_sql("Create table table_xyz (col_1 integer)", ignore_errors=[3804])
|
|
88
|
+
|
|
89
|
+
# Example 5: Drop table 'test_table' which does not exists.
|
|
90
|
+
# Ignore all the errors if table not exists.
|
|
91
|
+
result = execute_sql("drop table test_table", ignore_errors='all')
|
|
92
|
+
|
|
71
93
|
"""
|
|
72
94
|
# Validate argument types
|
|
73
95
|
arg_info_matrix = []
|
|
74
96
|
arg_info_matrix.append(["statement", statement, False, str, True])
|
|
75
97
|
arg_info_matrix.append(["parameters", parameters, True, (tuple, list), False])
|
|
98
|
+
arg_info_matrix.append(["ignore_errors", ignore_errors, True, (int, _ListOf(int), str), True])
|
|
76
99
|
|
|
77
100
|
_Validators._validate_function_arguments(arg_info_matrix)
|
|
78
101
|
|
|
102
|
+
# Validate permitted values, if its string.
|
|
103
|
+
if isinstance(ignore_errors, str):
|
|
104
|
+
_Validators._validate_permitted_values(ignore_errors, ['ALL'], "ignore_errors")
|
|
105
|
+
|
|
79
106
|
from teradataml.context.context import get_context
|
|
80
107
|
if get_context() is not None:
|
|
81
108
|
tdsql_con = get_context().raw_connection().driver_connection
|
|
82
109
|
cursor = tdsql_con.cursor()
|
|
83
|
-
|
|
110
|
+
# If user specifies error codes, then ignore those.
|
|
111
|
+
if not isinstance(ignore_errors, str):
|
|
112
|
+
return cursor.execute(statement, parameters, ignore_errors)
|
|
113
|
+
|
|
114
|
+
try:
|
|
115
|
+
return cursor.execute(statement, parameters)
|
|
116
|
+
except OperationalError as oe:
|
|
117
|
+
# When 'ignore_errors' is set to 'all', ignore all
|
|
118
|
+
# the errors during execution.
|
|
119
|
+
if ignore_errors == 'all':
|
|
120
|
+
pass
|
|
121
|
+
else:
|
|
122
|
+
raise oe
|
|
84
123
|
else:
|
|
85
124
|
raise TeradataMlException(Messages.get_message(MessageCodes.INVALID_CONTEXT_CONNECTION),
|
|
86
125
|
MessageCodes.INVALID_CONTEXT_CONNECTION)
|