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.

Files changed (96) hide show
  1. teradataml/README.md +210 -0
  2. teradataml/__init__.py +1 -1
  3. teradataml/_version.py +1 -1
  4. teradataml/analytics/analytic_function_executor.py +162 -76
  5. teradataml/analytics/byom/__init__.py +1 -1
  6. teradataml/analytics/json_parser/__init__.py +2 -0
  7. teradataml/analytics/json_parser/analytic_functions_argument.py +95 -2
  8. teradataml/analytics/json_parser/metadata.py +22 -4
  9. teradataml/analytics/sqle/DecisionTreePredict.py +3 -2
  10. teradataml/analytics/sqle/NaiveBayesPredict.py +3 -2
  11. teradataml/analytics/sqle/__init__.py +3 -0
  12. teradataml/analytics/utils.py +4 -1
  13. teradataml/automl/__init__.py +2369 -464
  14. teradataml/automl/autodataprep/__init__.py +15 -0
  15. teradataml/automl/custom_json_utils.py +184 -112
  16. teradataml/automl/data_preparation.py +113 -58
  17. teradataml/automl/data_transformation.py +154 -53
  18. teradataml/automl/feature_engineering.py +113 -53
  19. teradataml/automl/feature_exploration.py +548 -25
  20. teradataml/automl/model_evaluation.py +260 -32
  21. teradataml/automl/model_training.py +399 -206
  22. teradataml/clients/auth_client.py +2 -2
  23. teradataml/common/aed_utils.py +11 -2
  24. teradataml/common/bulk_exposed_utils.py +4 -2
  25. teradataml/common/constants.py +62 -2
  26. teradataml/common/garbagecollector.py +50 -21
  27. teradataml/common/messagecodes.py +47 -2
  28. teradataml/common/messages.py +19 -1
  29. teradataml/common/sqlbundle.py +23 -6
  30. teradataml/common/utils.py +116 -10
  31. teradataml/context/aed_context.py +16 -10
  32. teradataml/data/Employee.csv +5 -0
  33. teradataml/data/Employee_Address.csv +4 -0
  34. teradataml/data/Employee_roles.csv +5 -0
  35. teradataml/data/JulesBelvezeDummyData.csv +100 -0
  36. teradataml/data/byom_example.json +5 -0
  37. teradataml/data/creditcard_data.csv +284618 -0
  38. teradataml/data/docs/byom/docs/ONNXSeq2Seq.py +255 -0
  39. teradataml/data/docs/sqle/docs_17_10/NGramSplitter.py +1 -1
  40. teradataml/data/docs/sqle/docs_17_20/NGramSplitter.py +1 -1
  41. teradataml/data/docs/sqle/docs_17_20/TextParser.py +1 -1
  42. teradataml/data/jsons/byom/ONNXSeq2Seq.json +287 -0
  43. teradataml/data/jsons/sqle/20.00/AI_AnalyzeSentiment.json +3 -7
  44. teradataml/data/jsons/sqle/20.00/AI_AskLLM.json +3 -7
  45. teradataml/data/jsons/sqle/20.00/AI_DetectLanguage.json +3 -7
  46. teradataml/data/jsons/sqle/20.00/AI_ExtractKeyPhrases.json +3 -7
  47. teradataml/data/jsons/sqle/20.00/AI_MaskPII.json +3 -7
  48. teradataml/data/jsons/sqle/20.00/AI_RecognizeEntities.json +3 -7
  49. teradataml/data/jsons/sqle/20.00/AI_RecognizePIIEntities.json +3 -7
  50. teradataml/data/jsons/sqle/20.00/AI_TextClassifier.json +3 -7
  51. teradataml/data/jsons/sqle/20.00/AI_TextEmbeddings.json +3 -7
  52. teradataml/data/jsons/sqle/20.00/AI_TextSummarize.json +3 -7
  53. teradataml/data/jsons/sqle/20.00/AI_TextTranslate.json +3 -7
  54. teradataml/data/jsons/sqle/20.00/TD_API_AzureML.json +151 -0
  55. teradataml/data/jsons/sqle/20.00/TD_API_Sagemaker.json +182 -0
  56. teradataml/data/jsons/sqle/20.00/TD_API_VertexAI.json +183 -0
  57. teradataml/data/load_example_data.py +29 -11
  58. teradataml/data/payment_fraud_dataset.csv +10001 -0
  59. teradataml/data/teradataml_example.json +67 -0
  60. teradataml/dataframe/copy_to.py +714 -54
  61. teradataml/dataframe/dataframe.py +1153 -33
  62. teradataml/dataframe/dataframe_utils.py +8 -3
  63. teradataml/dataframe/functions.py +168 -1
  64. teradataml/dataframe/setop.py +4 -1
  65. teradataml/dataframe/sql.py +141 -9
  66. teradataml/dbutils/dbutils.py +470 -35
  67. teradataml/dbutils/filemgr.py +1 -1
  68. teradataml/hyperparameter_tuner/optimizer.py +456 -142
  69. teradataml/lib/aed_0_1.dll +0 -0
  70. teradataml/lib/libaed_0_1.dylib +0 -0
  71. teradataml/lib/libaed_0_1.so +0 -0
  72. teradataml/lib/libaed_0_1_aarch64.so +0 -0
  73. teradataml/scriptmgmt/UserEnv.py +234 -34
  74. teradataml/scriptmgmt/lls_utils.py +43 -17
  75. teradataml/sdk/_json_parser.py +1 -1
  76. teradataml/sdk/api_client.py +9 -6
  77. teradataml/sdk/modelops/_client.py +3 -0
  78. teradataml/series/series.py +12 -7
  79. teradataml/store/feature_store/constants.py +601 -234
  80. teradataml/store/feature_store/feature_store.py +2886 -616
  81. teradataml/store/feature_store/mind_map.py +639 -0
  82. teradataml/store/feature_store/models.py +5831 -214
  83. teradataml/store/feature_store/utils.py +390 -0
  84. teradataml/table_operators/table_operator_util.py +1 -1
  85. teradataml/table_operators/templates/dataframe_register.template +6 -2
  86. teradataml/table_operators/templates/dataframe_udf.template +6 -2
  87. teradataml/utils/docstring.py +527 -0
  88. teradataml/utils/dtypes.py +93 -0
  89. teradataml/utils/internal_buffer.py +2 -2
  90. teradataml/utils/utils.py +41 -2
  91. teradataml/utils/validators.py +694 -17
  92. {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/METADATA +213 -2
  93. {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/RECORD +96 -81
  94. {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/WHEEL +0 -0
  95. {teradataml-20.0.0.6.dist-info → teradataml-20.0.0.7.dist-info}/top_level.txt +0 -0
  96. {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
- return cursor.execute(statement, parameters)
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)