teradataml 20.0.0.1__py3-none-any.whl → 20.0.0.3__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/LICENSE.pdf +0 -0
- teradataml/README.md +306 -0
- teradataml/__init__.py +10 -3
- teradataml/_version.py +1 -1
- teradataml/analytics/__init__.py +3 -2
- teradataml/analytics/analytic_function_executor.py +299 -16
- teradataml/analytics/analytic_query_generator.py +92 -0
- teradataml/analytics/byom/__init__.py +3 -2
- teradataml/analytics/json_parser/metadata.py +13 -3
- teradataml/analytics/json_parser/utils.py +13 -6
- teradataml/analytics/meta_class.py +40 -1
- teradataml/analytics/sqle/DecisionTreePredict.py +1 -1
- teradataml/analytics/sqle/__init__.py +11 -2
- teradataml/analytics/table_operator/__init__.py +4 -3
- teradataml/analytics/uaf/__init__.py +21 -2
- teradataml/analytics/utils.py +66 -1
- teradataml/analytics/valib.py +1 -1
- teradataml/automl/__init__.py +1502 -323
- teradataml/automl/custom_json_utils.py +139 -61
- teradataml/automl/data_preparation.py +247 -307
- teradataml/automl/data_transformation.py +32 -12
- teradataml/automl/feature_engineering.py +325 -86
- teradataml/automl/model_evaluation.py +44 -35
- teradataml/automl/model_training.py +122 -153
- teradataml/catalog/byom.py +8 -8
- teradataml/clients/pkce_client.py +1 -1
- teradataml/common/__init__.py +2 -1
- teradataml/common/constants.py +72 -0
- teradataml/common/deprecations.py +13 -7
- teradataml/common/garbagecollector.py +152 -120
- teradataml/common/messagecodes.py +11 -2
- teradataml/common/messages.py +4 -1
- teradataml/common/sqlbundle.py +26 -4
- teradataml/common/utils.py +225 -14
- teradataml/common/wrapper_utils.py +1 -1
- teradataml/context/context.py +82 -2
- teradataml/data/SQL_Fundamentals.pdf +0 -0
- teradataml/data/complaints_test_tokenized.csv +353 -0
- teradataml/data/complaints_tokens_model.csv +348 -0
- teradataml/data/covid_confirm_sd.csv +83 -0
- teradataml/data/dataframe_example.json +27 -1
- teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +2 -0
- teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
- teradataml/data/docs/sqle/docs_17_20/Shap.py +203 -0
- teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
- teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
- teradataml/data/docs/sqle/docs_17_20/TextParser.py +3 -3
- teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
- teradataml/data/docs/tableoperator/docs_17_20/Image2Matrix.py +118 -0
- teradataml/data/docs/uaf/docs_17_20/ACF.py +1 -10
- teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +35 -5
- teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +3 -1
- teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
- teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
- teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +3 -2
- teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/Convolve.py +13 -10
- teradataml/data/docs/uaf/docs_17_20/Convolve2.py +4 -1
- teradataml/data/docs/uaf/docs_17_20/CopyArt.py +145 -0
- teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +5 -4
- teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +4 -4
- teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
- teradataml/data/docs/uaf/docs_17_20/DWT2D.py +214 -0
- teradataml/data/docs/uaf/docs_17_20/DickeyFuller.py +18 -21
- teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
- teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +9 -31
- teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +4 -2
- teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +1 -8
- teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
- teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
- teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
- teradataml/data/docs/uaf/docs_17_20/LineSpec.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/MAMean.py +3 -3
- teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
- teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +15 -6
- teradataml/data/docs/uaf/docs_17_20/PACF.py +0 -1
- teradataml/data/docs/uaf/docs_17_20/Portman.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +2 -2
- teradataml/data/docs/uaf/docs_17_20/Resample.py +9 -1
- teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
- teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +17 -10
- teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +1 -1
- teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +3 -1
- teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
- teradataml/data/dwt2d_dataTable.csv +65 -0
- teradataml/data/dwt_dataTable.csv +8 -0
- teradataml/data/dwt_filterTable.csv +3 -0
- teradataml/data/finance_data4.csv +13 -0
- teradataml/data/grocery_transaction.csv +19 -0
- teradataml/data/idwt2d_dataTable.csv +5 -0
- teradataml/data/idwt_dataTable.csv +8 -0
- teradataml/data/idwt_filterTable.csv +3 -0
- teradataml/data/interval_data.csv +5 -0
- teradataml/data/jsons/paired_functions.json +14 -0
- teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +9 -9
- teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
- teradataml/data/jsons/sqle/17.20/TD_Shap.json +222 -0
- teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
- teradataml/data/jsons/sqle/17.20/TD_TextParser.json +1 -1
- teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
- teradataml/data/jsons/sqle/20.00/TD_KMeans.json +250 -0
- teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +266 -0
- teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +278 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_COPYART.json +71 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
- teradataml/data/jsons/tableoperator/17.20/IMAGE2MATRIX.json +53 -0
- teradataml/data/jsons/uaf/17.20/TD_ACF.json +1 -18
- teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +3 -16
- teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +0 -3
- teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +5 -3
- teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
- teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
- teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +0 -3
- teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +0 -2
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +2 -1
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +2 -5
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +3 -6
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +1 -3
- teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +0 -5
- teradataml/data/jsons/uaf/17.20/TD_DFFT.json +1 -4
- teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +2 -7
- teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +1 -2
- teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +0 -2
- teradataml/data/jsons/uaf/17.20/TD_DICKEY_FULLER.json +10 -19
- teradataml/data/jsons/uaf/17.20/TD_DTW.json +3 -6
- teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
- teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
- teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +16 -30
- teradataml/data/jsons/uaf/17.20/{TD_HOLT_WINTERS_FORECAST.json → TD_HOLT_WINTERS_FORECASTER.json} +1 -2
- teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +1 -15
- teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
- teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
- teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
- teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +1 -3
- teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
- teradataml/data/jsons/uaf/17.20/TD_PACF.json +2 -2
- teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +5 -5
- teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +48 -28
- teradataml/data/jsons/uaf/17.20/TD_SAX.json +210 -0
- teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +12 -6
- teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +0 -1
- teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +8 -8
- teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +1 -1
- teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +410 -0
- teradataml/data/load_example_data.py +8 -2
- teradataml/data/medical_readings.csv +101 -0
- teradataml/data/naivebayestextclassifier_example.json +1 -1
- teradataml/data/naivebayestextclassifierpredict_example.json +11 -0
- teradataml/data/patient_profile.csv +101 -0
- teradataml/data/peppers.png +0 -0
- teradataml/data/real_values.csv +14 -0
- teradataml/data/sax_example.json +8 -0
- teradataml/data/scripts/deploy_script.py +1 -1
- teradataml/data/scripts/lightgbm/dataset.template +157 -0
- teradataml/data/scripts/lightgbm/lightgbm_class_functions.template +247 -0
- teradataml/data/scripts/lightgbm/lightgbm_function.template +216 -0
- teradataml/data/scripts/lightgbm/lightgbm_sklearn.template +159 -0
- teradataml/data/scripts/sklearn/sklearn_fit.py +194 -160
- teradataml/data/scripts/sklearn/sklearn_fit_predict.py +136 -115
- teradataml/data/scripts/sklearn/sklearn_function.template +34 -16
- teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +155 -137
- teradataml/data/scripts/sklearn/sklearn_neighbors.py +1 -1
- teradataml/data/scripts/sklearn/sklearn_score.py +12 -3
- teradataml/data/scripts/sklearn/sklearn_transform.py +162 -24
- teradataml/data/star_pivot.csv +8 -0
- teradataml/data/target_udt_data.csv +8 -0
- teradataml/data/templates/open_source_ml.json +3 -1
- teradataml/data/teradataml_example.json +20 -1
- teradataml/data/timestamp_data.csv +4 -0
- teradataml/data/titanic_dataset_unpivoted.csv +19 -0
- teradataml/data/uaf_example.json +55 -1
- teradataml/data/unpivot_example.json +15 -0
- teradataml/data/url_data.csv +9 -0
- teradataml/data/vectordistance_example.json +4 -0
- teradataml/data/windowdfft.csv +16 -0
- teradataml/dataframe/copy_to.py +1 -1
- teradataml/dataframe/data_transfer.py +5 -3
- teradataml/dataframe/dataframe.py +1002 -201
- teradataml/dataframe/fastload.py +3 -3
- teradataml/dataframe/functions.py +867 -0
- teradataml/dataframe/row.py +160 -0
- teradataml/dataframe/setop.py +2 -2
- teradataml/dataframe/sql.py +840 -33
- teradataml/dataframe/window.py +1 -1
- teradataml/dbutils/dbutils.py +878 -34
- teradataml/dbutils/filemgr.py +48 -1
- teradataml/geospatial/geodataframe.py +1 -1
- teradataml/geospatial/geodataframecolumn.py +1 -1
- teradataml/hyperparameter_tuner/optimizer.py +13 -13
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/opensource/__init__.py +1 -1
- teradataml/opensource/{sklearn/_class.py → _class.py} +102 -17
- teradataml/opensource/_lightgbm.py +950 -0
- teradataml/opensource/{sklearn/_wrapper_utils.py → _wrapper_utils.py} +1 -2
- teradataml/opensource/{sklearn/constants.py → constants.py} +13 -10
- teradataml/opensource/sklearn/__init__.py +0 -1
- teradataml/opensource/sklearn/_sklearn_wrapper.py +1019 -574
- teradataml/options/__init__.py +9 -23
- teradataml/options/configure.py +42 -4
- teradataml/options/display.py +2 -2
- teradataml/plot/axis.py +4 -4
- teradataml/scriptmgmt/UserEnv.py +13 -9
- teradataml/scriptmgmt/lls_utils.py +77 -23
- teradataml/store/__init__.py +13 -0
- teradataml/store/feature_store/__init__.py +0 -0
- teradataml/store/feature_store/constants.py +291 -0
- teradataml/store/feature_store/feature_store.py +2223 -0
- teradataml/store/feature_store/models.py +1505 -0
- teradataml/store/vector_store/__init__.py +1586 -0
- teradataml/table_operators/Script.py +2 -2
- teradataml/table_operators/TableOperator.py +106 -20
- teradataml/table_operators/query_generator.py +3 -0
- teradataml/table_operators/table_operator_query_generator.py +3 -1
- teradataml/table_operators/table_operator_util.py +102 -56
- teradataml/table_operators/templates/dataframe_register.template +69 -0
- teradataml/table_operators/templates/dataframe_udf.template +63 -0
- teradataml/telemetry_utils/__init__.py +0 -0
- teradataml/telemetry_utils/queryband.py +52 -0
- teradataml/utils/dtypes.py +4 -2
- teradataml/utils/validators.py +34 -2
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/METADATA +311 -3
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/RECORD +240 -157
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/WHEEL +0 -0
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/top_level.txt +0 -0
- {teradataml-20.0.0.1.dist-info → teradataml-20.0.0.3.dist-info}/zip-safe +0 -0
teradataml/options/__init__.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
from teradataml.common.deprecations import argument_deprecation
|
|
1
2
|
from teradataml.common.exceptions import TeradataMlException
|
|
2
3
|
from teradataml.common.messagecodes import MessageCodes
|
|
3
4
|
from teradataml.common.messages import Messages
|
|
4
5
|
from teradataml.options.configure import configure
|
|
5
6
|
from teradataml.utils.internal_buffer import _InternalBuffer
|
|
6
|
-
from
|
|
7
|
+
from teradataml.telemetry_utils.queryband import collect_queryband
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
@collect_queryband(queryband="StCnfgPrms")
|
|
@@ -18,21 +19,6 @@ def set_config_params(**kwargs):
|
|
|
18
19
|
Optional Argument.
|
|
19
20
|
Specifies keyword arguments. Accepts following keyword arguments:
|
|
20
21
|
|
|
21
|
-
auth_token:
|
|
22
|
-
Optional Parameter.
|
|
23
|
-
Specifies the authentication token to connect to VantageCloud Lake.
|
|
24
|
-
Notes:
|
|
25
|
-
* Authentication token will expire after a specific time.
|
|
26
|
-
One can get the new authentication token and set it again.
|
|
27
|
-
* if "auth_token" is set through this function, then this function
|
|
28
|
-
should always be used only after create_context.
|
|
29
|
-
Types: str
|
|
30
|
-
|
|
31
|
-
ues_url:
|
|
32
|
-
Optional Parameter.
|
|
33
|
-
Specifies the URL for User Environment Service in VantageCloud Lake.
|
|
34
|
-
Types: str
|
|
35
|
-
|
|
36
22
|
certificate_file:
|
|
37
23
|
Optional Parameter.
|
|
38
24
|
Specifies the path of the certificate file, which is used in
|
|
@@ -93,9 +79,7 @@ def set_config_params(**kwargs):
|
|
|
93
79
|
EXAMPLES:
|
|
94
80
|
# Example 1: Set configuration params using set_config_params() function.
|
|
95
81
|
>>> from teradataml import set_config_params
|
|
96
|
-
>>> set_config_params(
|
|
97
|
-
... ues_url="https://teracloud/v1/accounts/xyz-234-76085/open-analytics",
|
|
98
|
-
... certificate_file="cert.crt",
|
|
82
|
+
>>> set_config_params(certificate_file="cert.crt",
|
|
99
83
|
... default_varchar_size=512,
|
|
100
84
|
... val_install_location="VAL_USER",
|
|
101
85
|
... read_nos_function_mapping="read_nos_fm",
|
|
@@ -107,7 +91,6 @@ def set_config_params(**kwargs):
|
|
|
107
91
|
# Example 2: Alternatively, set configuration parameters without using set_config_params() function.
|
|
108
92
|
# To do so, we will use configure module.
|
|
109
93
|
>>> from teradataml import configure
|
|
110
|
-
>>> configure.ues_url="https://teracloud/v1/accounts/xyz-234-76085/open-analytics"
|
|
111
94
|
>>> configure.certificate_file="cert.crt"
|
|
112
95
|
>>> configure.default_varchar_size=512
|
|
113
96
|
>>> configure.val_install_location="VAL_USER"
|
|
@@ -118,9 +101,12 @@ def set_config_params(**kwargs):
|
|
|
118
101
|
"""
|
|
119
102
|
for option in kwargs:
|
|
120
103
|
try:
|
|
121
|
-
if option == "auth_token":
|
|
122
|
-
|
|
123
|
-
|
|
104
|
+
if option == "auth_token" or option == 'ues_url':
|
|
105
|
+
raise TeradataMlException(Messages.get_message(
|
|
106
|
+
MessageCodes.FUNC_EXECUTION_FAILED, 'set_config_params',
|
|
107
|
+
'Setting of parameter \'{}\' is prohibited from set_config_params(). '
|
|
108
|
+
'Use set_auth_token() to set parameter.'.format(option)),
|
|
109
|
+
MessageCodes.FUNC_EXECUTION_FAILED)
|
|
124
110
|
else:
|
|
125
111
|
setattr(configure, option, kwargs[option])
|
|
126
112
|
except AttributeError as e:
|
teradataml/options/configure.py
CHANGED
|
@@ -58,6 +58,8 @@ class _Configure(_ConfigureSuper):
|
|
|
58
58
|
indb_install_location = _create_property('indb_install_location')
|
|
59
59
|
openml_user_env = _create_property('openml_user_env')
|
|
60
60
|
local_storage = _create_property('local_storage')
|
|
61
|
+
stored_procedure_install_location = _create_property('stored_procedure_install_location')
|
|
62
|
+
table_operator = _create_property('table_operator')
|
|
61
63
|
|
|
62
64
|
def __init__(self, default_varchar_size=1024, column_casesensitive_handler = False,
|
|
63
65
|
vantage_version="vantage1.1", val_install_location=None,
|
|
@@ -66,7 +68,8 @@ class _Configure(_ConfigureSuper):
|
|
|
66
68
|
read_nos_function_mapping="read_nos", write_nos_function_mapping="write_nos",
|
|
67
69
|
cran_repositories=None, inline_plot=True,
|
|
68
70
|
indb_install_location="/var/opt/teradata/languages/sles12sp3/Python/",
|
|
69
|
-
openml_user_env=None, local_storage=None
|
|
71
|
+
openml_user_env=None, local_storage=None, stored_procedure_install_location="SYSLIB",
|
|
72
|
+
table_operator=None):
|
|
70
73
|
|
|
71
74
|
"""
|
|
72
75
|
PARAMETERS:
|
|
@@ -170,6 +173,23 @@ class _Configure(_ConfigureSuper):
|
|
|
170
173
|
Example:
|
|
171
174
|
# Set the garbage collector location to "/Users/gc/"
|
|
172
175
|
teradataml.options.configure.local_storage = "/Users/gc/"
|
|
176
|
+
|
|
177
|
+
stored_procedure_install_location:
|
|
178
|
+
Specifies the name of the database where stored procedures
|
|
179
|
+
are installed.
|
|
180
|
+
Types: string
|
|
181
|
+
Example:
|
|
182
|
+
# Set the Stored Procedure install location to 'SYSLIB'
|
|
183
|
+
# when stored procedures are installed in 'SYSLIB'.
|
|
184
|
+
teradataml.options.configure.stored_procedure_install_location = "SYSLIB"
|
|
185
|
+
|
|
186
|
+
table_operator:
|
|
187
|
+
Specifies the name of the table operator.
|
|
188
|
+
Types: string
|
|
189
|
+
Example:
|
|
190
|
+
# Set the table operator name to "Script"
|
|
191
|
+
teradataml.options.configure.table_operator = "Script"
|
|
192
|
+
|
|
173
193
|
"""
|
|
174
194
|
super().__init__()
|
|
175
195
|
super().__setattr__('default_varchar_size', default_varchar_size)
|
|
@@ -187,6 +207,8 @@ class _Configure(_ConfigureSuper):
|
|
|
187
207
|
super().__setattr__('indb_install_location', indb_install_location)
|
|
188
208
|
super().__setattr__('openml_user_env', openml_user_env)
|
|
189
209
|
super().__setattr__('local_storage', local_storage)
|
|
210
|
+
super().__setattr__('stored_procedure_install_location', stored_procedure_install_location)
|
|
211
|
+
super().__setattr__('table_operator', table_operator)
|
|
190
212
|
|
|
191
213
|
# internal configurations
|
|
192
214
|
# These configurations are internal and should not be
|
|
@@ -216,6 +238,8 @@ class _Configure(_ConfigureSuper):
|
|
|
216
238
|
# Internal parameter, that is used for specifying the URL to be used as
|
|
217
239
|
# base URL in UES REST calls
|
|
218
240
|
super().__setattr__('ues_url', None)
|
|
241
|
+
# base URL in Vector Store REST calls
|
|
242
|
+
super().__setattr__('_vector_store_base_url', None)
|
|
219
243
|
# Internal parameter, that is used to specify the certificate file in a secured HTTP request.
|
|
220
244
|
super().__setattr__('certificate_file', False)
|
|
221
245
|
# Internal parameter, that is used for specify the maximum size of the file
|
|
@@ -301,7 +325,7 @@ class _Configure(_ConfigureSuper):
|
|
|
301
325
|
'read_nos_function_mapping', 'write_nos_function_mapping',
|
|
302
326
|
'_byom_model_catalog_database', '_byom_model_catalog_table',
|
|
303
327
|
'_byom_model_catalog_license', '_byom_model_catalog_license_source',
|
|
304
|
-
'indb_install_location', 'local_storage']:
|
|
328
|
+
'indb_install_location', 'local_storage', 'stored_procedure_install_location']:
|
|
305
329
|
if not isinstance(value, str):
|
|
306
330
|
raise TeradataMlException(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name,
|
|
307
331
|
'str'),
|
|
@@ -313,7 +337,7 @@ class _Configure(_ConfigureSuper):
|
|
|
313
337
|
Messages.get_message(MessageCodes.PATH_NOT_FOUND).format(value),
|
|
314
338
|
MessageCodes.PATH_NOT_FOUND)
|
|
315
339
|
|
|
316
|
-
elif name in {'ues_url', '_oauth_end_point', '_oauth_client_id'}:
|
|
340
|
+
elif name in {'ues_url', '_oauth_end_point', '_oauth_client_id', '_vector_store_base_url'}:
|
|
317
341
|
|
|
318
342
|
if not isinstance(value, str):
|
|
319
343
|
raise TypeError(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name, 'str'))
|
|
@@ -321,7 +345,7 @@ class _Configure(_ConfigureSuper):
|
|
|
321
345
|
if len(value) == 0:
|
|
322
346
|
raise ValueError(Messages.get_message(MessageCodes.ARG_EMPTY, name))
|
|
323
347
|
|
|
324
|
-
if name
|
|
348
|
+
if name in ['ues_url', '_vector_store_base_url']:
|
|
325
349
|
value = value[: -1] if value.endswith("/") else value
|
|
326
350
|
|
|
327
351
|
elif name in ['temp_table_database', 'temp_view_database',
|
|
@@ -350,6 +374,20 @@ class _Configure(_ConfigureSuper):
|
|
|
350
374
|
if not isinstance(value, UserEnv) and not isinstance(value, type(None)):
|
|
351
375
|
raise TypeError(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name, 'UserEnv or None'))
|
|
352
376
|
|
|
377
|
+
elif name == 'table_operator':
|
|
378
|
+
if not isinstance(value, str) and not isinstance(value, type(None)):
|
|
379
|
+
raise TypeError(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE, name, 'str or None'))
|
|
380
|
+
|
|
381
|
+
if value is not None:
|
|
382
|
+
valid_names = ['script', 'apply']
|
|
383
|
+
value = value.lower()
|
|
384
|
+
if value not in valid_names:
|
|
385
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.INVALID_ARG_VALUE,
|
|
386
|
+
value,
|
|
387
|
+
name,
|
|
388
|
+
"a value in {}".format(valid_names)),
|
|
389
|
+
MessageCodes.INVALID_ARG_VALUE)
|
|
390
|
+
|
|
353
391
|
super().__setattr__(name, value)
|
|
354
392
|
else:
|
|
355
393
|
raise AttributeError("'{}' object has no attribute '{}'".format(self.__class__.__name__, name))
|
teradataml/options/display.py
CHANGED
|
@@ -58,7 +58,7 @@ class _Display(_DisplaySuper):
|
|
|
58
58
|
byte_encoding = 'base16',
|
|
59
59
|
print_sqlmr_query = False,
|
|
60
60
|
blob_length=10,
|
|
61
|
-
suppress_vantage_runtime_warnings=
|
|
61
|
+
suppress_vantage_runtime_warnings=True,
|
|
62
62
|
geometry_column_length=30):
|
|
63
63
|
"""
|
|
64
64
|
PARAMETERS:
|
|
@@ -111,7 +111,7 @@ class _Display(_DisplaySuper):
|
|
|
111
111
|
Specifies whether to display the warnings raised by the Vantage or not.
|
|
112
112
|
When set to True, warnings raised by Vantage are not displayed.
|
|
113
113
|
Otherwise, warnings are displayed.
|
|
114
|
-
Default Value:
|
|
114
|
+
Default Value: True
|
|
115
115
|
Types: bool
|
|
116
116
|
Example:
|
|
117
117
|
display.suppress_vantage_runtime_warnings = True
|
teradataml/plot/axis.py
CHANGED
|
@@ -951,7 +951,7 @@ class Axis:
|
|
|
951
951
|
# Execute the node and create the table in Vantage.
|
|
952
952
|
if self.__y_axis_data[0]._parent_df._table_name is None:
|
|
953
953
|
# Assuming all the columns are from same DataFrame.
|
|
954
|
-
|
|
954
|
+
self.__y_axis_data[0]._parent_df.materialize()
|
|
955
955
|
|
|
956
956
|
series = TDSeries(data=_df if self.ignore_nulls else self.__x_axis_data[0]._parent_df,
|
|
957
957
|
id=self.__series_identifier,
|
|
@@ -994,7 +994,7 @@ class Axis:
|
|
|
994
994
|
# Remove null values from DataFrame
|
|
995
995
|
if self.ignore_nulls:
|
|
996
996
|
_df = _df.dropna()
|
|
997
|
-
|
|
997
|
+
_df.materialize()
|
|
998
998
|
series = TDSeries(data=_df,
|
|
999
999
|
id="id",
|
|
1000
1000
|
row_index="x",
|
|
@@ -1049,7 +1049,7 @@ class Axis:
|
|
|
1049
1049
|
|
|
1050
1050
|
# Execute the node and create the table/view in Vantage.
|
|
1051
1051
|
if self.__y_axis_data[0]._parent_df._table_name is None:
|
|
1052
|
-
|
|
1052
|
+
self.__y_axis_data[0]._parent_df.materialize()
|
|
1053
1053
|
|
|
1054
1054
|
matrix = TDMatrix(data=_df if self.ignore_nulls else self.__x_axis_data[0]._parent_df,
|
|
1055
1055
|
id=self.__series_identifier,
|
|
@@ -1077,7 +1077,7 @@ class Axis:
|
|
|
1077
1077
|
# Remove null values from DataFrame
|
|
1078
1078
|
if self.ignore_nulls:
|
|
1079
1079
|
_df = _df.dropna()
|
|
1080
|
-
|
|
1080
|
+
_df.materialize()
|
|
1081
1081
|
matrix = TDMatrix(data=_df,
|
|
1082
1082
|
id="id",
|
|
1083
1083
|
row_index="x",
|
teradataml/scriptmgmt/UserEnv.py
CHANGED
|
@@ -32,7 +32,7 @@ from teradataml.common.messagecodes import MessageCodes
|
|
|
32
32
|
from teradataml.common.utils import UtilFuncs
|
|
33
33
|
from teradataml.utils.validators import _Validators
|
|
34
34
|
from urllib.parse import urlparse
|
|
35
|
-
from
|
|
35
|
+
from teradataml.telemetry_utils.queryband import collect_queryband
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def _get_ues_url(env_type="users", **kwargs):
|
|
@@ -205,7 +205,7 @@ def _process_ues_response(api_name, response, success_status_code=None):
|
|
|
205
205
|
def _get_auth_token():
|
|
206
206
|
"""
|
|
207
207
|
DESCRIPTION:
|
|
208
|
-
Internal function to get Authentication token for all
|
|
208
|
+
Internal function to get Authentication token for all CCP enabled REST calls
|
|
209
209
|
|
|
210
210
|
PARAMETERS:
|
|
211
211
|
None
|
|
@@ -238,8 +238,8 @@ def _get_auth_token():
|
|
|
238
238
|
|
|
239
239
|
# Store the jwt token in internal class attribute.
|
|
240
240
|
_InternalBuffer.add(auth_token=_AuthToken(token=token_data["access_token"]))
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
if _InternalBuffer.get("auth_token"):
|
|
242
|
+
return {"Authorization": "Bearer {}".format(_InternalBuffer.get("auth_token").value)}
|
|
243
243
|
|
|
244
244
|
|
|
245
245
|
class UserEnv:
|
|
@@ -535,6 +535,8 @@ class UserEnv:
|
|
|
535
535
|
|
|
536
536
|
# Check if file exists or not.
|
|
537
537
|
_Validators._validate_file_exists(file_path)
|
|
538
|
+
# Check if file is empty or not.
|
|
539
|
+
_Validators._check_empty_file(file_path)
|
|
538
540
|
|
|
539
541
|
try:
|
|
540
542
|
# If file size is more than 10 MB, upload the file to cloud and export it to UES.
|
|
@@ -681,11 +683,11 @@ class UserEnv:
|
|
|
681
683
|
"x-ms-blob-type": CloudProvider.X_MS_BLOB_TYPE.value}
|
|
682
684
|
|
|
683
685
|
# Initiate file upload to cloud.
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
686
|
+
with open(file_path, 'rb') as fp:
|
|
687
|
+
response = UtilFuncs._http_request(cloud_storage_url,
|
|
688
|
+
HTTPRequest.PUT,
|
|
689
|
+
data=fp,
|
|
690
|
+
headers=headers)
|
|
689
691
|
|
|
690
692
|
# Since the API is not for UES, it is better to validate and raise error separately.
|
|
691
693
|
if not (200 <= response.status_code < 300):
|
|
@@ -3521,6 +3523,8 @@ class UserEnv:
|
|
|
3521
3523
|
user environment created in Vantage Languages Ecosystem. If
|
|
3522
3524
|
model with same name already exists in the remote user
|
|
3523
3525
|
environment, error is thrown.
|
|
3526
|
+
Note:
|
|
3527
|
+
Maximum size of the model should be less than or equal to 5GB.
|
|
3524
3528
|
|
|
3525
3529
|
PARAMETERS:
|
|
3526
3530
|
model_path:
|
|
@@ -23,6 +23,7 @@ from json.decoder import JSONDecodeError
|
|
|
23
23
|
from teradataml import configure
|
|
24
24
|
from teradataml.context.context import _get_user, get_connection
|
|
25
25
|
from teradataml.common.constants import HTTPRequest, AsyncStatusColumns
|
|
26
|
+
from teradataml.common.deprecations import argument_deprecation
|
|
26
27
|
from teradataml.common.exceptions import TeradataMlException
|
|
27
28
|
from teradataml.common.messages import Messages
|
|
28
29
|
from teradataml.common.messagecodes import MessageCodes
|
|
@@ -38,8 +39,7 @@ import warnings
|
|
|
38
39
|
import webbrowser
|
|
39
40
|
from urllib.parse import parse_qs, urlparse
|
|
40
41
|
from teradataml.utils.utils import _async_run_id_info
|
|
41
|
-
from
|
|
42
|
-
|
|
42
|
+
from teradataml.telemetry_utils.queryband import collect_queryband
|
|
43
43
|
|
|
44
44
|
@collect_queryband(queryband="LstBsEnv")
|
|
45
45
|
def list_base_envs():
|
|
@@ -437,11 +437,18 @@ def __create_envs(template):
|
|
|
437
437
|
if libs or libs_file_path:
|
|
438
438
|
print("Installing libraries in environment '{}'...".format(env_name))
|
|
439
439
|
try:
|
|
440
|
-
env_handle.install_lib(libs, libs_file_path)
|
|
441
|
-
|
|
440
|
+
status = env_handle.install_lib(libs, libs_file_path)
|
|
441
|
+
if status['Stage'][1] == 'Errored':
|
|
442
|
+
err_message = status['Additional Details'][1].replace("Error with package maintenance -> ", "\n")
|
|
443
|
+
raise Exception(err_message)
|
|
444
|
+
else:
|
|
445
|
+
print("Libraries installation in environment '{}' - Completed.".format(env_name))
|
|
442
446
|
except Exception as lib_installation_failure:
|
|
443
|
-
|
|
444
|
-
|
|
447
|
+
error_code = MessageCodes.FUNC_EXECUTION_FAILED
|
|
448
|
+
error_msg = Messages.get_message(error_code,
|
|
449
|
+
"'install_lib' request for enviornment: '{}'".format(env_name),
|
|
450
|
+
'\n'+str(lib_installation_failure))
|
|
451
|
+
print(error_msg)
|
|
445
452
|
errored = errored or True
|
|
446
453
|
pass
|
|
447
454
|
|
|
@@ -741,9 +748,11 @@ def create_env(env_name=None, base_env=None, desc=None, template=None, conda_env
|
|
|
741
748
|
# Validate arguments
|
|
742
749
|
_Validators._validate_function_arguments(__arg_info_matrix, skip_empty_check=False)
|
|
743
750
|
|
|
744
|
-
# Get the latest python base env in OpenAF, if base_env is not provided
|
|
751
|
+
# Get the latest python base env in OpenAF, if base_env is not provided,
|
|
752
|
+
# Or if base_env is provided and not in the list of base envs.
|
|
745
753
|
# Note: By default python base env is obtained.
|
|
746
|
-
if not base_env
|
|
754
|
+
if not base_env or \
|
|
755
|
+
(base_env and base_env.lower() not in list_base_envs()['base_name'].str.lower().to_list()):
|
|
747
756
|
base_env = __get_default_base_env()
|
|
748
757
|
if not desc:
|
|
749
758
|
desc = "This env '{}' is created with base env '{}'.".format(env_name, base_env)
|
|
@@ -1121,7 +1130,8 @@ def get_env(env_name):
|
|
|
1121
1130
|
# Get environments created by the current logged in user.
|
|
1122
1131
|
user_envs_df = list_user_envs()
|
|
1123
1132
|
|
|
1124
|
-
if
|
|
1133
|
+
if (user_envs_df is None or
|
|
1134
|
+
(not user_envs_df.empty and env_name not in user_envs_df.env_name.values)):
|
|
1125
1135
|
msg_code = MessageCodes.FUNC_EXECUTION_FAILED
|
|
1126
1136
|
error_msg = Messages.get_message(msg_code, "get_env()", "User environment '{}' not found."
|
|
1127
1137
|
" Use 'create_env()' function to create"
|
|
@@ -1549,7 +1559,8 @@ def get_user_env():
|
|
|
1549
1559
|
|
|
1550
1560
|
|
|
1551
1561
|
@collect_queryband(queryband="StAthTkn")
|
|
1552
|
-
|
|
1562
|
+
@argument_deprecation("20.00.00.04", "ues_url", False, "base_url")
|
|
1563
|
+
def set_auth_token(base_url=None, client_id=None, pat_token=None, pem_file=None, **kwargs):
|
|
1553
1564
|
"""
|
|
1554
1565
|
DESCRIPTION:
|
|
1555
1566
|
Function to set the Authentication token to connect to User Environment Service
|
|
@@ -1562,11 +1573,17 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1562
1573
|
Refresh token still works but only for OAuth authentication.
|
|
1563
1574
|
|
|
1564
1575
|
PARAMETERS:
|
|
1576
|
+
|
|
1565
1577
|
ues_url:
|
|
1566
1578
|
Required Argument.
|
|
1567
1579
|
Specifies the URL for User Environment Service in VantageCloud Lake.
|
|
1568
1580
|
Types: str
|
|
1569
1581
|
|
|
1582
|
+
base_url:
|
|
1583
|
+
Required Argument.
|
|
1584
|
+
Specifies the CCP endpoint URL.
|
|
1585
|
+
Types: str
|
|
1586
|
+
|
|
1570
1587
|
client_id:
|
|
1571
1588
|
Optional Argument.
|
|
1572
1589
|
Specifies the id of the application that requests the access token from
|
|
@@ -1600,6 +1617,16 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1600
1617
|
Default Value: 31536000
|
|
1601
1618
|
Types: int
|
|
1602
1619
|
|
|
1620
|
+
auth_token:
|
|
1621
|
+
Optional Parameter.
|
|
1622
|
+
Specifies the authentication token to connect to VantageCloud Lake.
|
|
1623
|
+
Notes:
|
|
1624
|
+
* if "auth_token" is set through this function, then this function
|
|
1625
|
+
should always be used only after create_context.
|
|
1626
|
+
* use this option only if user has got JWT token and wants to set the same
|
|
1627
|
+
instead of generating it again from this function.
|
|
1628
|
+
Types: str
|
|
1629
|
+
|
|
1603
1630
|
RETURNS:
|
|
1604
1631
|
True, if the operation is successful.
|
|
1605
1632
|
|
|
@@ -1610,16 +1637,16 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1610
1637
|
|
|
1611
1638
|
# Example 1: Set the Authentication token using default client_id.
|
|
1612
1639
|
>>> import getpass
|
|
1613
|
-
>>> set_auth_token(
|
|
1640
|
+
>>> set_auth_token(base_url=getpass.getpass("ues_url : "))
|
|
1614
1641
|
|
|
1615
1642
|
# Example 2: Set the Authentication token by specifying the client_id.
|
|
1616
|
-
>>> set_auth_token(
|
|
1643
|
+
>>> set_auth_token(base_url=getpass.getpass("base_url : "),
|
|
1617
1644
|
... client_id=getpass.getpass("client_id : "))
|
|
1618
1645
|
|
|
1619
1646
|
# Example 3: Set the Authentication token by specifying the "pem_file" and "pat_token"
|
|
1620
1647
|
# without specifying "username".
|
|
1621
1648
|
>>> import getpass
|
|
1622
|
-
>>> set_auth_token(
|
|
1649
|
+
>>> set_auth_token(base_url=getpass.getpass("base_url : "),
|
|
1623
1650
|
... pat_token=getpass.getpass("pat_token : "),
|
|
1624
1651
|
... pem_file=getpass.getpass("pem_file : "))
|
|
1625
1652
|
True
|
|
@@ -1627,7 +1654,7 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1627
1654
|
# Example 4: Set the Authentication token by specifying the "pem_file" and "pat_token"
|
|
1628
1655
|
# and "username".
|
|
1629
1656
|
>>> import getpass
|
|
1630
|
-
>>> set_auth_token(
|
|
1657
|
+
>>> set_auth_token(base_url=getpass.getpass("base_url : "),
|
|
1631
1658
|
... pat_token=getpass.getpass("pat_token : "),
|
|
1632
1659
|
... pem_file=getpass.getpass("pem_file : "))
|
|
1633
1660
|
... username = "alice")
|
|
@@ -1639,8 +1666,12 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1639
1666
|
raise TeradataMlException(Messages.get_message(MessageCodes.INVALID_CONTEXT_CONNECTION),
|
|
1640
1667
|
MessageCodes.INVALID_CONTEXT_CONNECTION)
|
|
1641
1668
|
|
|
1669
|
+
# Getting the ues_url.
|
|
1670
|
+
ues_url = kwargs.get("ues_url", None)
|
|
1671
|
+
|
|
1642
1672
|
__arg_info_matrix = []
|
|
1643
|
-
__arg_info_matrix.append(["
|
|
1673
|
+
__arg_info_matrix.append(["base_url", base_url, True, (str), True])
|
|
1674
|
+
__arg_info_matrix.append(["ues_url", ues_url, True, (str), True])
|
|
1644
1675
|
__arg_info_matrix.append(["client_id", client_id, True, (str), True])
|
|
1645
1676
|
__arg_info_matrix.append(["pat_token", pat_token, True, (str), True])
|
|
1646
1677
|
__arg_info_matrix.append(["pem_file", pem_file, True, (str), True])
|
|
@@ -1648,12 +1679,38 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1648
1679
|
username = kwargs.get("username", None)
|
|
1649
1680
|
__arg_info_matrix.append((["username", username, True, (str), True]))
|
|
1650
1681
|
|
|
1682
|
+
auth_token = kwargs.get("auth_token")
|
|
1683
|
+
__arg_info_matrix.append((["auth_token", auth_token, True, (str), True]))
|
|
1684
|
+
|
|
1651
1685
|
expiration_time = kwargs.get("expiration_time", 31536000)
|
|
1652
1686
|
__arg_info_matrix.append((["expiration_time", expiration_time, True, (int), True]))
|
|
1653
1687
|
|
|
1654
1688
|
# Validate arguments.
|
|
1655
1689
|
_Validators._validate_function_arguments(__arg_info_matrix)
|
|
1656
1690
|
|
|
1691
|
+
# base_url should not end with 'open-analytics' or 'data-insights'
|
|
1692
|
+
if base_url:
|
|
1693
|
+
if base_url.endswith('open-analytics') or base_url.endswith('data-insights'):
|
|
1694
|
+
message = Messages.get_message(MessageCodes.ARG_NONE,
|
|
1695
|
+
"base_url", "ending with 'data-insights' or 'open-analytics", None)
|
|
1696
|
+
raise TeradataMlException(message, MessageCodes.ARG_NONE)
|
|
1697
|
+
|
|
1698
|
+
# Set the vector_store_base_url. This should only be done if base_url is set.
|
|
1699
|
+
# In case ues_url is set, vector_store_base_url should not be set.
|
|
1700
|
+
configure._vector_store_base_url = f'{base_url}/data-insights'
|
|
1701
|
+
|
|
1702
|
+
# If ues_url is provided, then use it as base_url.
|
|
1703
|
+
base_url = kwargs.get("ues_url", base_url)
|
|
1704
|
+
|
|
1705
|
+
# Set the OpenAF url.
|
|
1706
|
+
# If ues_url is present use that otherwise generate it from base_url.
|
|
1707
|
+
configure.ues_url = ues_url if ues_url else f'{base_url}/open-analytics'
|
|
1708
|
+
|
|
1709
|
+
# If user pass Auth token, set it.
|
|
1710
|
+
if auth_token:
|
|
1711
|
+
_InternalBuffer.add(auth_token=_AuthToken(token=auth_token))
|
|
1712
|
+
return True
|
|
1713
|
+
|
|
1657
1714
|
if client_id and any([pat_token, pem_file]):
|
|
1658
1715
|
message = Messages.get_message(MessageCodes.EITHER_THIS_OR_THAT_ARGUMENT,
|
|
1659
1716
|
"client_id", "pat_token' and 'pem_file")
|
|
@@ -1669,16 +1726,16 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1669
1726
|
if pem_file is not None:
|
|
1670
1727
|
_Validators._validate_file_exists(pem_file)
|
|
1671
1728
|
|
|
1672
|
-
# Extract the base URL
|
|
1673
|
-
url_parser = urlparse(
|
|
1674
|
-
|
|
1729
|
+
# Extract the base URL.
|
|
1730
|
+
url_parser = urlparse(base_url)
|
|
1731
|
+
parsed_base_url = "{}://{}".format(url_parser.scheme, url_parser.netloc)
|
|
1675
1732
|
netloc = url_parser.netloc.split('.')[0]
|
|
1676
1733
|
|
|
1677
1734
|
# Check if the authentication is PAT based or OAuth.
|
|
1678
1735
|
if all(arg is None for arg in [pat_token, pem_file]):
|
|
1679
1736
|
configure._oauth = True
|
|
1680
1737
|
client_id = "{}-oaf-device".format(netloc) if client_id is None else client_id
|
|
1681
|
-
da_wf = _DAWorkflow(
|
|
1738
|
+
da_wf = _DAWorkflow(parsed_base_url, client_id)
|
|
1682
1739
|
token_data = da_wf._get_token_data()
|
|
1683
1740
|
|
|
1684
1741
|
# Set Open AF parameters.
|
|
@@ -1701,7 +1758,7 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1701
1758
|
|
|
1702
1759
|
# Construct a dictionary to be passed to _AuthWorkflow().
|
|
1703
1760
|
state_dict = {}
|
|
1704
|
-
state_dict["base_url"] =
|
|
1761
|
+
state_dict["base_url"] = parsed_base_url
|
|
1705
1762
|
state_dict["org_id"] = org_id
|
|
1706
1763
|
state_dict["pat_token"] = pat_token
|
|
1707
1764
|
state_dict["pem_file"] = pem_file
|
|
@@ -1713,7 +1770,4 @@ def set_auth_token(ues_url, client_id=None, pat_token=None, pem_file=None, **kwa
|
|
|
1713
1770
|
# Store the jwt token in internal class attribute.
|
|
1714
1771
|
_InternalBuffer.add(auth_token=_AuthToken(token=token_data))
|
|
1715
1772
|
|
|
1716
|
-
# Set Open AF parameters.
|
|
1717
|
-
configure.ues_url = ues_url
|
|
1718
|
-
|
|
1719
1773
|
return True
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright (c) 2024 by Teradata Corporation. All rights reserved.
|
|
3
|
+
TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
|
|
4
|
+
|
|
5
|
+
Primary Owner: pradeep.garre@teradata.com
|
|
6
|
+
Secondary Owner: aanchal.kavedia@teradata.com
|
|
7
|
+
|
|
8
|
+
This file imports components from Feature Store and Vector Store.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from teradataml.store.feature_store.feature_store import FeatureStore
|
|
12
|
+
from teradataml.store.feature_store.models import *
|
|
13
|
+
from teradataml.store.vector_store import *
|
|
File without changes
|