teradataml 20.0.0.4__py3-none-any.whl → 20.0.0.5__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/LICENSE-3RD-PARTY.pdf +0 -0
- teradataml/README.md +86 -13
- teradataml/__init__.py +2 -1
- teradataml/_version.py +2 -2
- teradataml/analytics/analytic_function_executor.py +7 -12
- teradataml/analytics/json_parser/analytic_functions_argument.py +4 -0
- teradataml/analytics/sqle/__init__.py +16 -1
- teradataml/analytics/utils.py +15 -1
- teradataml/automl/__init__.py +290 -106
- teradataml/automl/autodataprep/__init__.py +471 -0
- teradataml/automl/data_preparation.py +29 -10
- teradataml/automl/data_transformation.py +11 -0
- teradataml/automl/feature_engineering.py +64 -4
- teradataml/automl/feature_exploration.py +639 -25
- teradataml/automl/model_training.py +1 -1
- teradataml/clients/auth_client.py +2 -2
- teradataml/common/constants.py +61 -26
- teradataml/common/messagecodes.py +2 -1
- teradataml/common/messages.py +5 -4
- teradataml/common/utils.py +255 -37
- teradataml/context/context.py +225 -87
- teradataml/data/apriori_example.json +22 -0
- teradataml/data/docs/sqle/docs_17_20/Apriori.py +138 -0
- teradataml/data/docs/sqle/docs_17_20/NERExtractor.py +121 -0
- teradataml/data/docs/sqle/docs_17_20/NGramSplitter.py +3 -3
- teradataml/data/docs/sqle/docs_17_20/SMOTE.py +212 -0
- teradataml/data/docs/sqle/docs_17_20/TextMorph.py +119 -0
- teradataml/data/docs/sqle/docs_17_20/TextParser.py +54 -3
- teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/DFFT.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/DFFT2.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/DFFTConv.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +4 -4
- teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +6 -6
- teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +4 -4
- teradataml/data/docs/uaf/docs_17_20/MultivarRegr.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/PACF.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/PowerTransform.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/Resample.py +5 -5
- teradataml/data/docs/uaf/docs_17_20/SAX.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/SimpleExp.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/Smoothma.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/UNDIFF.py +1 -1
- teradataml/data/jsons/sqle/17.20/NGramSplitter.json +6 -6
- teradataml/data/jsons/sqle/17.20/TD_Apriori.json +181 -0
- teradataml/data/jsons/sqle/17.20/TD_NERExtractor.json +145 -0
- teradataml/data/jsons/sqle/17.20/TD_SMOTE.json +267 -0
- teradataml/data/jsons/sqle/17.20/TD_TextMorph.json +134 -0
- teradataml/data/jsons/sqle/17.20/TD_TextParser.json +114 -9
- teradataml/data/jsons/sqle/20.00/AI_AnalyzeSentiment.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_AskLLM.json +420 -0
- teradataml/data/jsons/sqle/20.00/AI_DetectLanguage.json +343 -0
- teradataml/data/jsons/sqle/20.00/AI_ExtractKeyPhrases.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_MaskPII.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_RecognizeEntities.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_RecognizePIIEntities.json +328 -0
- teradataml/data/jsons/sqle/20.00/AI_TextClassifier.json +359 -0
- teradataml/data/jsons/sqle/20.00/AI_TextEmbeddings.json +360 -0
- teradataml/data/jsons/sqle/20.00/AI_TextSummarize.json +343 -0
- teradataml/data/jsons/sqle/20.00/AI_TextTranslate.json +343 -0
- teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +2 -2
- teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +1 -1
- teradataml/data/ner_dict.csv +8 -0
- teradataml/data/ner_input_eng.csv +7 -0
- teradataml/data/ner_rule.csv +5 -0
- teradataml/data/pos_input.csv +40 -0
- teradataml/data/tdnerextractor_example.json +14 -0
- teradataml/data/teradataml_example.json +13 -0
- teradataml/data/textmorph_example.json +5 -0
- teradataml/data/to_num_data.csv +4 -0
- teradataml/data/tochar_data.csv +5 -0
- teradataml/data/trans_dense.csv +16 -0
- teradataml/data/trans_sparse.csv +55 -0
- teradataml/dataframe/copy_to.py +37 -26
- teradataml/dataframe/data_transfer.py +61 -45
- teradataml/dataframe/dataframe.py +130 -50
- teradataml/dataframe/dataframe_utils.py +15 -2
- teradataml/dataframe/functions.py +109 -9
- teradataml/dataframe/sql.py +328 -76
- teradataml/dbutils/dbutils.py +33 -13
- teradataml/dbutils/filemgr.py +14 -10
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/opensource/_base.py +6 -157
- teradataml/options/configure.py +4 -5
- teradataml/scriptmgmt/UserEnv.py +305 -38
- teradataml/scriptmgmt/lls_utils.py +376 -130
- teradataml/store/__init__.py +1 -1
- teradataml/table_operators/Apply.py +16 -1
- teradataml/table_operators/Script.py +20 -1
- teradataml/table_operators/table_operator_util.py +58 -9
- teradataml/utils/dtypes.py +2 -1
- teradataml/utils/internal_buffer.py +22 -2
- teradataml/utils/validators.py +313 -57
- {teradataml-20.0.0.4.dist-info → teradataml-20.0.0.5.dist-info}/METADATA +89 -14
- {teradataml-20.0.0.4.dist-info → teradataml-20.0.0.5.dist-info}/RECORD +107 -77
- {teradataml-20.0.0.4.dist-info → teradataml-20.0.0.5.dist-info}/WHEEL +0 -0
- {teradataml-20.0.0.4.dist-info → teradataml-20.0.0.5.dist-info}/top_level.txt +0 -0
- {teradataml-20.0.0.4.dist-info → teradataml-20.0.0.5.dist-info}/zip-safe +0 -0
teradataml/opensource/_base.py
CHANGED
|
@@ -89,22 +89,14 @@ class _GenericObjectWrapper:
|
|
|
89
89
|
else:
|
|
90
90
|
self._env = UtilFuncs._create_or_get_env("open_source_ml.json")
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
else:
|
|
96
|
-
set_session_param("searchuifdbpath",self._db_name)
|
|
97
|
-
from teradataml.dbutils.dbutils import db_python_version_diff
|
|
98
|
-
if len(db_python_version_diff()) > 0:
|
|
99
|
-
# Raise exception when python versions don't match between Vantage and local.
|
|
100
|
-
from teradataml.context import context as tdmlctx
|
|
101
|
-
py_major_vantage_version = tdmlctx.python_version_vantage.rsplit(".", 1)[0]
|
|
102
|
-
raise TeradataMlException(Messages.get_message(MessageCodes.PYTHON_VERSION_MISMATCH,
|
|
103
|
-
tdmlctx.python_version_vantage, py_major_vantage_version),
|
|
104
|
-
MessageCodes.PYTHON_VERSION_MISMATCH)
|
|
92
|
+
# Check if the Python interpreter major versions are consistent between Vantage and local.
|
|
93
|
+
UtilFuncs._check_python_version_diff(self._env)
|
|
105
94
|
|
|
106
95
|
# Raise warning when python package versions don't match between Vantage and local.
|
|
107
|
-
|
|
96
|
+
# OPENSOURCE_PACKAGE_NAME is set for each opensource package, but not for the base class.
|
|
97
|
+
# Add a check to avoid running this function for the base class.
|
|
98
|
+
if self.OPENSOURCE_PACKAGE_NAME is not None:
|
|
99
|
+
UtilFuncs._check_package_version_diff(self.OPENSOURCE_PACKAGE_NAME.value, self._pkgs, self._env)
|
|
108
100
|
|
|
109
101
|
global _file_installed
|
|
110
102
|
## Flag to check whether trained model is installed or not.
|
|
@@ -121,149 +113,6 @@ class _GenericObjectWrapper:
|
|
|
121
113
|
|
|
122
114
|
_file_installed = True
|
|
123
115
|
|
|
124
|
-
def _process_python_version_diff_lake(self):
|
|
125
|
-
"""
|
|
126
|
-
DESCRIPTION:
|
|
127
|
-
Internal function to process Python interpreter version differences between Lake user environment and local.
|
|
128
|
-
Note:
|
|
129
|
-
* Raises an exception if the Python interpreter major versions are not consistent between
|
|
130
|
-
Lake user environment and local.
|
|
131
|
-
|
|
132
|
-
PARAMETERS:
|
|
133
|
-
None
|
|
134
|
-
|
|
135
|
-
RETURNS:
|
|
136
|
-
None
|
|
137
|
-
|
|
138
|
-
RAISES:
|
|
139
|
-
TeradataMlException
|
|
140
|
-
|
|
141
|
-
EXAMPLES:
|
|
142
|
-
self._process_python_version_diff_lake()
|
|
143
|
-
"""
|
|
144
|
-
# Get the Python interpreter version of the user environment.
|
|
145
|
-
env_list = list_user_envs()
|
|
146
|
-
user_env_name = self._env.env_name
|
|
147
|
-
env_base_version = env_list[env_list['env_name'] == user_env_name].base_env_name.values[0]
|
|
148
|
-
python_env = env_base_version.split("_")[1]
|
|
149
|
-
|
|
150
|
-
# Get the Python interpreter version of the local environment.
|
|
151
|
-
from teradataml.context import context as tdmlctx
|
|
152
|
-
python_local = tdmlctx.python_version_local.rsplit(".", 1)[0]
|
|
153
|
-
# Check if the Python interpreter major versions are consistent between Lake user environment and local.
|
|
154
|
-
# If not, raise an exception.
|
|
155
|
-
if python_env != python_local:
|
|
156
|
-
raise TeradataMlException(Messages.get_message(MessageCodes.PYTHON_VERSION_MISMATCH_OAF,
|
|
157
|
-
python_env, python_local),
|
|
158
|
-
MessageCodes.PYTHON_VERSION_MISMATCH_OAF)
|
|
159
|
-
|
|
160
|
-
def _process_package_differences(self):
|
|
161
|
-
"""
|
|
162
|
-
DESCRIPTION:
|
|
163
|
-
Internal function to process package differences between Vantage and local.
|
|
164
|
-
Note:
|
|
165
|
-
* Raises a warning if the versions of certain Python packages are not consistent between Vantage and local.
|
|
166
|
-
|
|
167
|
-
PARAMETERS:
|
|
168
|
-
None
|
|
169
|
-
|
|
170
|
-
RETURNS:
|
|
171
|
-
None
|
|
172
|
-
|
|
173
|
-
RAISES:
|
|
174
|
-
PackageNotFoundError: If the package is not found in the local environment for OAF.
|
|
175
|
-
|
|
176
|
-
EXAMPLES:
|
|
177
|
-
self._process_package_differences()
|
|
178
|
-
"""
|
|
179
|
-
# OPENSOURCE_PACKAGE_NAME is set for each opensource package, but not for the base class.
|
|
180
|
-
# Add a check to avoid running this function for the base class.
|
|
181
|
-
if self.OPENSOURCE_PACKAGE_NAME is None:
|
|
182
|
-
return
|
|
183
|
-
_is_packages_verfied_in_vantage = _packages_verified_in_vantage.get(
|
|
184
|
-
self.OPENSOURCE_PACKAGE_NAME.value, None)
|
|
185
|
-
if _is_packages_verfied_in_vantage:
|
|
186
|
-
return
|
|
187
|
-
|
|
188
|
-
if self._is_lake_system:
|
|
189
|
-
env_pkg_df = self._env.libs
|
|
190
|
-
pkgs_dict = dict(zip(env_pkg_df['name'], env_pkg_df['version']))
|
|
191
|
-
|
|
192
|
-
i = 0
|
|
193
|
-
from importlib.metadata import version
|
|
194
|
-
warning_raised = False
|
|
195
|
-
for pkg in self._pkgs:
|
|
196
|
-
env_version = pkgs_dict.get(pkg)
|
|
197
|
-
try:
|
|
198
|
-
local_version = version(pkg)
|
|
199
|
-
except Exception as e:
|
|
200
|
-
raise
|
|
201
|
-
if env_version != local_version:
|
|
202
|
-
warning_raised = True
|
|
203
|
-
if i == 0:
|
|
204
|
-
strr = f"{pkg}=={local_version}\n"
|
|
205
|
-
i += 1
|
|
206
|
-
else:
|
|
207
|
-
strr += f"{pkg}=={local_version}\n"
|
|
208
|
-
|
|
209
|
-
# If there are differences in package versions, display a warning message to the user.
|
|
210
|
-
# about the package differences and the requirements file created for the user to install the packages
|
|
211
|
-
if warning_raised:
|
|
212
|
-
file_name = f"requirements_{self.OPENSOURCE_PACKAGE_NAME.value}.txt"
|
|
213
|
-
req_file = os.path.join(self._tdml_tmp_dir, file_name)
|
|
214
|
-
with open(req_file, "w") as f:
|
|
215
|
-
f.write(strr)
|
|
216
|
-
_pkgs = "', '".join(self._pkgs[:-1]) + "' and '" + self._pkgs[-1]
|
|
217
|
-
warning_msg = "The versions of certain Python packages are not consistent between "\
|
|
218
|
-
"Lake user environment and local. OpenSourceML compares the versions of '{}' "\
|
|
219
|
-
f"(and also matches the patterns of these packages) used by 'td_{self.OPENSOURCE_PACKAGE_NAME.value}'. "\
|
|
220
|
-
"Teradata recommends same versions for all the Python packages between Lake "\
|
|
221
|
-
"user environment and local."
|
|
222
|
-
req = f"\nA requirements file listing all '{self.OPENSOURCE_PACKAGE_NAME.value}' " + \
|
|
223
|
-
f"related packages and their versions has been written to '{req_file}'. "+ \
|
|
224
|
-
"Update the Lake user environment with the required packages.\n"
|
|
225
|
-
|
|
226
|
-
warning_msg += req
|
|
227
|
-
warnings.warn(warning_msg.format(_pkgs), category=OneTimeUserWarning)
|
|
228
|
-
|
|
229
|
-
else:
|
|
230
|
-
# Check if the versions of Python packages are consistent between Vantage and local.
|
|
231
|
-
from teradataml.dbutils.dbutils import _db_python_package_version_diff
|
|
232
|
-
all_package_versions = _db_python_package_version_diff(self._pkgs, only_diff=False)
|
|
233
|
-
package_difference = \
|
|
234
|
-
all_package_versions[all_package_versions.vantage != all_package_versions.local]
|
|
235
|
-
# If there are differences in package versions, raise a warning.
|
|
236
|
-
if package_difference.shape[0] > 0:
|
|
237
|
-
_pkgs = "', '".join(self._pkgs[:-1]) + "' and '" + self._pkgs[-1]
|
|
238
|
-
warning_msg = "The versions of certain Python packages are not consistent between "\
|
|
239
|
-
"Vantage and local. User can identify them using db_python_package_version_diff() "\
|
|
240
|
-
"function. OpenSourceML compares the versions of '{}' (and also matches the "\
|
|
241
|
-
f"patterns of these packages) used by 'td_{self.OPENSOURCE_PACKAGE_NAME.value}'. Teradata "\
|
|
242
|
-
"recommends to maintain same versions for all the Python packages between Vantage "\
|
|
243
|
-
"and local."
|
|
244
|
-
i = 0
|
|
245
|
-
# Write the requirements file listing all the related packages and their versions.
|
|
246
|
-
for rec in all_package_versions.to_records():
|
|
247
|
-
if i == 0:
|
|
248
|
-
strr = f"{rec[1]}=={rec[2]}\n"
|
|
249
|
-
i += 1
|
|
250
|
-
else:
|
|
251
|
-
strr += f"{rec[1]}=={rec[2]}\n"
|
|
252
|
-
file_name = f"requirements_{self.OPENSOURCE_PACKAGE_NAME.value}.txt"
|
|
253
|
-
req_file = os.path.join(self._tdml_tmp_dir, file_name)
|
|
254
|
-
with open(req_file, "w") as f:
|
|
255
|
-
f.write(strr)
|
|
256
|
-
|
|
257
|
-
# Display a warning message to the user about the package differences
|
|
258
|
-
# and the requirements file created for the user to install the packages.
|
|
259
|
-
req = f"\nA requirements file listing all '{self.OPENSOURCE_PACKAGE_NAME.value}' " + \
|
|
260
|
-
f"related packages and their versions has been written to '{req_file}'.\n"
|
|
261
|
-
|
|
262
|
-
warning_msg += req
|
|
263
|
-
warnings.warn(warning_msg.format(_pkgs), category=OneTimeUserWarning)
|
|
264
|
-
|
|
265
|
-
_packages_verified_in_vantage[self.OPENSOURCE_PACKAGE_NAME.value] = True
|
|
266
|
-
|
|
267
116
|
def _get_columns_as_list(self, cols):
|
|
268
117
|
"""
|
|
269
118
|
Internal function to get columns as list of strings.
|
teradataml/options/configure.py
CHANGED
|
@@ -244,9 +244,9 @@ class _Configure(_ConfigureSuper):
|
|
|
244
244
|
super().__setattr__('ues_url', None)
|
|
245
245
|
# base URL in Vector Store REST calls
|
|
246
246
|
super().__setattr__('_vector_store_base_url', None)
|
|
247
|
-
#
|
|
248
|
-
# By default, it is set to
|
|
249
|
-
super().__setattr__('
|
|
247
|
+
# Internal parameter, which is used to specify whether SSL verification is to be done or not.
|
|
248
|
+
# By default, it is set to True.
|
|
249
|
+
super().__setattr__('_ssl_verify', True)
|
|
250
250
|
# Internal parameter, that is used to specify the certificate file in a secured HTTP request.
|
|
251
251
|
super().__setattr__('certificate_file', False)
|
|
252
252
|
# Internal parameter, that is used for specify the maximum size of the file
|
|
@@ -330,7 +330,7 @@ class _Configure(_ConfigureSuper):
|
|
|
330
330
|
"greater than or equal to"),
|
|
331
331
|
MessageCodes.TDMLDF_POSITIVE_INT)
|
|
332
332
|
elif name in ['column_casesensitive_handler', '_validate_metaexpression',
|
|
333
|
-
'_validate_gc', 'inline_plot', '_oauth', '
|
|
333
|
+
'_validate_gc', 'inline_plot', '_oauth', '_ssl_verify']:
|
|
334
334
|
|
|
335
335
|
if not isinstance(value, bool):
|
|
336
336
|
raise TeradataMlException(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name,
|
|
@@ -387,7 +387,6 @@ class _Configure(_ConfigureSuper):
|
|
|
387
387
|
MessageCodes.PATH_NOT_FOUND)
|
|
388
388
|
|
|
389
389
|
elif name in {'ues_url', '_oauth_end_point', '_oauth_client_id', '_vector_store_base_url'}:
|
|
390
|
-
|
|
391
390
|
if not isinstance(value, str):
|
|
392
391
|
raise TypeError(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name, 'str'))
|
|
393
392
|
|