teradataml 17.20.0.7__py3-none-any.whl → 20.0.0.0__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 +1864 -1640
- teradataml/__init__.py +70 -60
- teradataml/_version.py +11 -11
- teradataml/analytics/Transformations.py +2995 -2995
- teradataml/analytics/__init__.py +81 -83
- teradataml/analytics/analytic_function_executor.py +2013 -2010
- teradataml/analytics/analytic_query_generator.py +958 -958
- teradataml/analytics/byom/H2OPredict.py +514 -514
- teradataml/analytics/byom/PMMLPredict.py +437 -437
- teradataml/analytics/byom/__init__.py +14 -14
- teradataml/analytics/json_parser/__init__.py +130 -130
- teradataml/analytics/json_parser/analytic_functions_argument.py +1707 -1707
- teradataml/analytics/json_parser/json_store.py +191 -191
- teradataml/analytics/json_parser/metadata.py +1637 -1637
- teradataml/analytics/json_parser/utils.py +804 -803
- teradataml/analytics/meta_class.py +196 -196
- teradataml/analytics/sqle/DecisionTreePredict.py +455 -470
- teradataml/analytics/sqle/NaiveBayesPredict.py +419 -428
- teradataml/analytics/sqle/__init__.py +97 -110
- teradataml/analytics/sqle/json/decisiontreepredict_sqle.json +78 -78
- teradataml/analytics/sqle/json/naivebayespredict_sqle.json +62 -62
- teradataml/analytics/table_operator/__init__.py +10 -10
- teradataml/analytics/uaf/__init__.py +63 -63
- teradataml/analytics/utils.py +693 -692
- teradataml/analytics/valib.py +1603 -1600
- teradataml/automl/__init__.py +1628 -0
- teradataml/automl/custom_json_utils.py +1270 -0
- teradataml/automl/data_preparation.py +993 -0
- teradataml/automl/data_transformation.py +727 -0
- teradataml/automl/feature_engineering.py +1648 -0
- teradataml/automl/feature_exploration.py +547 -0
- teradataml/automl/model_evaluation.py +163 -0
- teradataml/automl/model_training.py +887 -0
- teradataml/catalog/__init__.py +1 -3
- teradataml/catalog/byom.py +1759 -1716
- teradataml/catalog/function_argument_mapper.py +859 -861
- teradataml/catalog/model_cataloging_utils.py +491 -1510
- teradataml/clients/pkce_client.py +481 -481
- teradataml/common/aed_utils.py +6 -2
- teradataml/common/bulk_exposed_utils.py +111 -111
- teradataml/common/constants.py +1433 -1441
- teradataml/common/deprecations.py +160 -0
- teradataml/common/exceptions.py +73 -73
- teradataml/common/formula.py +742 -742
- teradataml/common/garbagecollector.py +592 -635
- teradataml/common/messagecodes.py +422 -431
- teradataml/common/messages.py +227 -231
- teradataml/common/sqlbundle.py +693 -693
- teradataml/common/td_coltype_code_to_tdtype.py +48 -48
- teradataml/common/utils.py +2418 -2500
- teradataml/common/warnings.py +25 -25
- teradataml/common/wrapper_utils.py +1 -110
- teradataml/config/dummy_file1.cfg +4 -4
- teradataml/config/dummy_file2.cfg +2 -2
- teradataml/config/sqlengine_alias_definitions_v1.0 +13 -13
- teradataml/config/sqlengine_alias_definitions_v1.1 +19 -19
- teradataml/config/sqlengine_alias_definitions_v1.3 +18 -18
- teradataml/context/aed_context.py +217 -217
- teradataml/context/context.py +1071 -999
- teradataml/data/A_loan.csv +19 -19
- teradataml/data/BINARY_REALS_LEFT.csv +11 -11
- teradataml/data/BINARY_REALS_RIGHT.csv +11 -11
- teradataml/data/B_loan.csv +49 -49
- teradataml/data/BuoyData2.csv +17 -17
- teradataml/data/CONVOLVE2_COMPLEX_LEFT.csv +5 -5
- teradataml/data/CONVOLVE2_COMPLEX_RIGHT.csv +5 -5
- teradataml/data/Convolve2RealsLeft.csv +5 -5
- teradataml/data/Convolve2RealsRight.csv +5 -5
- teradataml/data/Convolve2ValidLeft.csv +11 -11
- teradataml/data/Convolve2ValidRight.csv +11 -11
- teradataml/data/DFFTConv_Real_8_8.csv +65 -65
- teradataml/data/Orders1_12mf.csv +24 -24
- teradataml/data/Pi_loan.csv +7 -7
- teradataml/data/SMOOTHED_DATA.csv +7 -7
- teradataml/data/TestDFFT8.csv +9 -9
- teradataml/data/TestRiver.csv +109 -109
- teradataml/data/Traindata.csv +28 -28
- teradataml/data/acf.csv +17 -17
- teradataml/data/adaboost_example.json +34 -34
- teradataml/data/adaboostpredict_example.json +24 -24
- teradataml/data/additional_table.csv +10 -10
- teradataml/data/admissions_test.csv +21 -21
- teradataml/data/admissions_train.csv +41 -41
- teradataml/data/admissions_train_nulls.csv +41 -41
- teradataml/data/ageandheight.csv +13 -13
- teradataml/data/ageandpressure.csv +31 -31
- teradataml/data/antiselect_example.json +36 -36
- teradataml/data/antiselect_input.csv +8 -8
- teradataml/data/antiselect_input_mixed_case.csv +8 -8
- teradataml/data/applicant_external.csv +6 -6
- teradataml/data/applicant_reference.csv +6 -6
- teradataml/data/arima_example.json +9 -9
- teradataml/data/assortedtext_input.csv +8 -8
- teradataml/data/attribution_example.json +33 -33
- teradataml/data/attribution_sample_table.csv +27 -27
- teradataml/data/attribution_sample_table1.csv +6 -6
- teradataml/data/attribution_sample_table2.csv +11 -11
- teradataml/data/bank_churn.csv +10001 -0
- teradataml/data/bank_web_clicks1.csv +42 -42
- teradataml/data/bank_web_clicks2.csv +91 -91
- teradataml/data/bank_web_url.csv +85 -85
- teradataml/data/barrier.csv +2 -2
- teradataml/data/barrier_new.csv +3 -3
- teradataml/data/betweenness_example.json +13 -13
- teradataml/data/bin_breaks.csv +8 -8
- teradataml/data/bin_fit_ip.csv +3 -3
- teradataml/data/binary_complex_left.csv +11 -11
- teradataml/data/binary_complex_right.csv +11 -11
- teradataml/data/binary_matrix_complex_left.csv +21 -21
- teradataml/data/binary_matrix_complex_right.csv +21 -21
- teradataml/data/binary_matrix_real_left.csv +21 -21
- teradataml/data/binary_matrix_real_right.csv +21 -21
- teradataml/data/blood2ageandweight.csv +26 -26
- teradataml/data/bmi.csv +501 -0
- teradataml/data/boston.csv +507 -507
- teradataml/data/buoydata_mix.csv +11 -11
- teradataml/data/burst_data.csv +5 -5
- teradataml/data/burst_example.json +20 -20
- teradataml/data/byom_example.json +17 -17
- teradataml/data/bytes_table.csv +3 -3
- teradataml/data/cal_housing_ex_raw.csv +70 -70
- teradataml/data/callers.csv +7 -7
- teradataml/data/calls.csv +10 -10
- teradataml/data/cars_hist.csv +33 -33
- teradataml/data/cat_table.csv +24 -24
- teradataml/data/ccm_example.json +31 -31
- teradataml/data/ccm_input.csv +91 -91
- teradataml/data/ccm_input2.csv +13 -13
- teradataml/data/ccmexample.csv +101 -101
- teradataml/data/ccmprepare_example.json +8 -8
- teradataml/data/ccmprepare_input.csv +91 -91
- teradataml/data/cfilter_example.json +12 -12
- teradataml/data/changepointdetection_example.json +18 -18
- teradataml/data/changepointdetectionrt_example.json +8 -8
- teradataml/data/chi_sq.csv +2 -2
- teradataml/data/churn_data.csv +14 -14
- teradataml/data/churn_emission.csv +35 -35
- teradataml/data/churn_initial.csv +3 -3
- teradataml/data/churn_state_transition.csv +5 -5
- teradataml/data/citedges_2.csv +745 -745
- teradataml/data/citvertices_2.csv +1210 -1210
- teradataml/data/clicks2.csv +16 -16
- teradataml/data/clickstream.csv +12 -12
- teradataml/data/clickstream1.csv +11 -11
- teradataml/data/closeness_example.json +15 -15
- teradataml/data/complaints.csv +21 -21
- teradataml/data/complaints_mini.csv +3 -3
- teradataml/data/complaints_testtoken.csv +224 -224
- teradataml/data/complaints_tokens_test.csv +353 -353
- teradataml/data/complaints_traintoken.csv +472 -472
- teradataml/data/computers_category.csv +1001 -1001
- teradataml/data/computers_test1.csv +1252 -1252
- teradataml/data/computers_train1.csv +5009 -5009
- teradataml/data/computers_train1_clustered.csv +5009 -5009
- teradataml/data/confusionmatrix_example.json +9 -9
- teradataml/data/conversion_event_table.csv +3 -3
- teradataml/data/corr_input.csv +17 -17
- teradataml/data/correlation_example.json +11 -11
- teradataml/data/coxhazardratio_example.json +39 -39
- teradataml/data/coxph_example.json +15 -15
- teradataml/data/coxsurvival_example.json +28 -28
- teradataml/data/cpt.csv +41 -41
- teradataml/data/credit_ex_merged.csv +45 -45
- teradataml/data/customer_loyalty.csv +301 -301
- teradataml/data/customer_loyalty_newseq.csv +31 -31
- teradataml/data/dataframe_example.json +146 -146
- teradataml/data/decisionforest_example.json +37 -37
- teradataml/data/decisionforestpredict_example.json +38 -38
- teradataml/data/decisiontree_example.json +21 -21
- teradataml/data/decisiontreepredict_example.json +45 -45
- teradataml/data/dfft2_size4_real.csv +17 -17
- teradataml/data/dfft2_test_matrix16.csv +17 -17
- teradataml/data/dfft2conv_real_4_4.csv +65 -65
- teradataml/data/diabetes.csv +443 -443
- teradataml/data/diabetes_test.csv +89 -89
- teradataml/data/dict_table.csv +5 -5
- teradataml/data/docperterm_table.csv +4 -4
- teradataml/data/docs/__init__.py +1 -1
- teradataml/data/docs/byom/docs/DataRobotPredict.py +180 -180
- teradataml/data/docs/byom/docs/DataikuPredict.py +177 -177
- teradataml/data/docs/byom/docs/H2OPredict.py +324 -324
- teradataml/data/docs/byom/docs/ONNXPredict.py +283 -283
- teradataml/data/docs/byom/docs/PMMLPredict.py +277 -277
- teradataml/data/docs/sqle/docs_17_10/Antiselect.py +82 -82
- teradataml/data/docs/sqle/docs_17_10/Attribution.py +199 -199
- teradataml/data/docs/sqle/docs_17_10/BincodeFit.py +171 -171
- teradataml/data/docs/sqle/docs_17_10/BincodeTransform.py +131 -130
- teradataml/data/docs/sqle/docs_17_10/CategoricalSummary.py +86 -86
- teradataml/data/docs/sqle/docs_17_10/ChiSq.py +90 -90
- teradataml/data/docs/sqle/docs_17_10/ColumnSummary.py +85 -85
- teradataml/data/docs/sqle/docs_17_10/ConvertTo.py +95 -95
- teradataml/data/docs/sqle/docs_17_10/DecisionForestPredict.py +139 -139
- teradataml/data/docs/sqle/docs_17_10/DecisionTreePredict.py +151 -151
- teradataml/data/docs/sqle/docs_17_10/FTest.py +160 -160
- teradataml/data/docs/sqle/docs_17_10/FillRowId.py +82 -82
- teradataml/data/docs/sqle/docs_17_10/Fit.py +87 -87
- teradataml/data/docs/sqle/docs_17_10/GLMPredict.py +144 -144
- teradataml/data/docs/sqle/docs_17_10/GetRowsWithMissingValues.py +84 -84
- teradataml/data/docs/sqle/docs_17_10/GetRowsWithoutMissingValues.py +81 -81
- teradataml/data/docs/sqle/docs_17_10/Histogram.py +164 -164
- teradataml/data/docs/sqle/docs_17_10/MovingAverage.py +134 -134
- teradataml/data/docs/sqle/docs_17_10/NGramSplitter.py +208 -208
- teradataml/data/docs/sqle/docs_17_10/NPath.py +265 -265
- teradataml/data/docs/sqle/docs_17_10/NaiveBayesPredict.py +116 -116
- teradataml/data/docs/sqle/docs_17_10/NaiveBayesTextClassifierPredict.py +176 -176
- teradataml/data/docs/sqle/docs_17_10/NumApply.py +147 -147
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingFit.py +132 -132
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingTransform.py +103 -103
- teradataml/data/docs/sqle/docs_17_10/OutlierFilterFit.py +165 -165
- teradataml/data/docs/sqle/docs_17_10/OutlierFilterTransform.py +101 -101
- teradataml/data/docs/sqle/docs_17_10/Pack.py +128 -128
- teradataml/data/docs/sqle/docs_17_10/PolynomialFeaturesFit.py +111 -111
- teradataml/data/docs/sqle/docs_17_10/PolynomialFeaturesTransform.py +102 -102
- teradataml/data/docs/sqle/docs_17_10/QQNorm.py +104 -104
- teradataml/data/docs/sqle/docs_17_10/RoundColumns.py +109 -109
- teradataml/data/docs/sqle/docs_17_10/RowNormalizeFit.py +117 -117
- teradataml/data/docs/sqle/docs_17_10/RowNormalizeTransform.py +99 -98
- teradataml/data/docs/sqle/docs_17_10/SVMSparsePredict.py +152 -152
- teradataml/data/docs/sqle/docs_17_10/ScaleFit.py +197 -197
- teradataml/data/docs/sqle/docs_17_10/ScaleTransform.py +99 -98
- teradataml/data/docs/sqle/docs_17_10/Sessionize.py +113 -113
- teradataml/data/docs/sqle/docs_17_10/SimpleImputeFit.py +116 -116
- teradataml/data/docs/sqle/docs_17_10/SimpleImputeTransform.py +98 -98
- teradataml/data/docs/sqle/docs_17_10/StrApply.py +187 -187
- teradataml/data/docs/sqle/docs_17_10/StringSimilarity.py +145 -145
- teradataml/data/docs/sqle/docs_17_10/Transform.py +105 -104
- teradataml/data/docs/sqle/docs_17_10/UnivariateStatistics.py +141 -141
- teradataml/data/docs/sqle/docs_17_10/Unpack.py +214 -214
- teradataml/data/docs/sqle/docs_17_10/WhichMax.py +83 -83
- teradataml/data/docs/sqle/docs_17_10/WhichMin.py +83 -83
- teradataml/data/docs/sqle/docs_17_10/ZTest.py +155 -155
- teradataml/data/docs/sqle/docs_17_20/ANOVA.py +126 -126
- teradataml/data/docs/sqle/docs_17_20/Antiselect.py +82 -82
- teradataml/data/docs/sqle/docs_17_20/Attribution.py +200 -200
- teradataml/data/docs/sqle/docs_17_20/BincodeFit.py +171 -171
- teradataml/data/docs/sqle/docs_17_20/BincodeTransform.py +139 -138
- teradataml/data/docs/sqle/docs_17_20/CategoricalSummary.py +86 -86
- teradataml/data/docs/sqle/docs_17_20/ChiSq.py +90 -90
- teradataml/data/docs/sqle/docs_17_20/ClassificationEvaluator.py +166 -166
- teradataml/data/docs/sqle/docs_17_20/ColumnSummary.py +85 -85
- teradataml/data/docs/sqle/docs_17_20/ColumnTransformer.py +243 -243
- teradataml/data/docs/sqle/docs_17_20/ConvertTo.py +113 -113
- teradataml/data/docs/sqle/docs_17_20/DecisionForest.py +279 -279
- teradataml/data/docs/sqle/docs_17_20/DecisionForestPredict.py +144 -144
- teradataml/data/docs/sqle/docs_17_20/DecisionTreePredict.py +135 -135
- teradataml/data/docs/sqle/docs_17_20/FTest.py +160 -160
- teradataml/data/docs/sqle/docs_17_20/FillRowId.py +82 -82
- teradataml/data/docs/sqle/docs_17_20/Fit.py +87 -87
- teradataml/data/docs/sqle/docs_17_20/GLM.py +380 -380
- teradataml/data/docs/sqle/docs_17_20/GLMPerSegment.py +414 -414
- teradataml/data/docs/sqle/docs_17_20/GLMPredict.py +144 -144
- teradataml/data/docs/sqle/docs_17_20/GLMPredictPerSegment.py +233 -234
- teradataml/data/docs/sqle/docs_17_20/GetFutileColumns.py +123 -123
- teradataml/data/docs/sqle/docs_17_20/GetRowsWithMissingValues.py +108 -108
- teradataml/data/docs/sqle/docs_17_20/GetRowsWithoutMissingValues.py +105 -105
- teradataml/data/docs/sqle/docs_17_20/Histogram.py +223 -223
- teradataml/data/docs/sqle/docs_17_20/KMeans.py +204 -204
- teradataml/data/docs/sqle/docs_17_20/KMeansPredict.py +144 -143
- teradataml/data/docs/sqle/docs_17_20/KNN.py +214 -214
- teradataml/data/docs/sqle/docs_17_20/MovingAverage.py +134 -134
- teradataml/data/docs/sqle/docs_17_20/NGramSplitter.py +208 -208
- teradataml/data/docs/sqle/docs_17_20/NPath.py +265 -265
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesPredict.py +116 -116
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierPredict.py +177 -176
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierTrainer.py +126 -126
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineFit.py +117 -117
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineTransform.py +112 -112
- teradataml/data/docs/sqle/docs_17_20/NumApply.py +147 -147
- teradataml/data/docs/sqle/docs_17_20/OneClassSVM.py +307 -307
- teradataml/data/docs/sqle/docs_17_20/OneClassSVMPredict.py +185 -184
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingFit.py +225 -225
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingTransform.py +115 -115
- teradataml/data/docs/sqle/docs_17_20/OrdinalEncodingFit.py +219 -219
- teradataml/data/docs/sqle/docs_17_20/OrdinalEncodingTransform.py +127 -127
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +189 -189
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterTransform.py +117 -112
- teradataml/data/docs/sqle/docs_17_20/Pack.py +128 -128
- teradataml/data/docs/sqle/docs_17_20/PolynomialFeaturesFit.py +111 -111
- teradataml/data/docs/sqle/docs_17_20/PolynomialFeaturesTransform.py +112 -111
- teradataml/data/docs/sqle/docs_17_20/QQNorm.py +104 -104
- teradataml/data/docs/sqle/docs_17_20/ROC.py +163 -163
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionFit.py +154 -154
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionMinComponents.py +106 -106
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionTransform.py +120 -120
- teradataml/data/docs/sqle/docs_17_20/RegressionEvaluator.py +211 -211
- teradataml/data/docs/sqle/docs_17_20/RoundColumns.py +108 -108
- teradataml/data/docs/sqle/docs_17_20/RowNormalizeFit.py +117 -117
- teradataml/data/docs/sqle/docs_17_20/RowNormalizeTransform.py +111 -110
- teradataml/data/docs/sqle/docs_17_20/SVM.py +413 -413
- teradataml/data/docs/sqle/docs_17_20/SVMPredict.py +202 -202
- teradataml/data/docs/sqle/docs_17_20/SVMSparsePredict.py +152 -152
- teradataml/data/docs/sqle/docs_17_20/ScaleFit.py +197 -197
- teradataml/data/docs/sqle/docs_17_20/ScaleTransform.py +110 -109
- teradataml/data/docs/sqle/docs_17_20/SentimentExtractor.py +206 -206
- teradataml/data/docs/sqle/docs_17_20/Sessionize.py +113 -113
- teradataml/data/docs/sqle/docs_17_20/Silhouette.py +152 -152
- teradataml/data/docs/sqle/docs_17_20/SimpleImputeFit.py +116 -116
- teradataml/data/docs/sqle/docs_17_20/SimpleImputeTransform.py +109 -108
- teradataml/data/docs/sqle/docs_17_20/StrApply.py +187 -187
- teradataml/data/docs/sqle/docs_17_20/StringSimilarity.py +145 -145
- teradataml/data/docs/sqle/docs_17_20/TDDecisionForestPredict.py +207 -207
- teradataml/data/docs/sqle/docs_17_20/TDGLMPredict.py +171 -171
- teradataml/data/docs/sqle/docs_17_20/TargetEncodingFit.py +266 -266
- teradataml/data/docs/sqle/docs_17_20/TargetEncodingTransform.py +141 -140
- teradataml/data/docs/sqle/docs_17_20/TextParser.py +172 -172
- teradataml/data/docs/sqle/docs_17_20/TrainTestSplit.py +159 -159
- teradataml/data/docs/sqle/docs_17_20/Transform.py +123 -123
- teradataml/data/docs/sqle/docs_17_20/UnivariateStatistics.py +141 -141
- teradataml/data/docs/sqle/docs_17_20/Unpack.py +214 -214
- teradataml/data/docs/sqle/docs_17_20/VectorDistance.py +168 -168
- teradataml/data/docs/sqle/docs_17_20/WhichMax.py +83 -83
- teradataml/data/docs/sqle/docs_17_20/WhichMin.py +83 -83
- teradataml/data/docs/sqle/docs_17_20/WordEmbeddings.py +236 -236
- teradataml/data/docs/sqle/docs_17_20/XGBoost.py +353 -353
- teradataml/data/docs/sqle/docs_17_20/XGBoostPredict.py +275 -275
- teradataml/data/docs/sqle/docs_17_20/ZTest.py +155 -155
- teradataml/data/docs/tableoperator/docs_17_00/ReadNOS.py +429 -429
- teradataml/data/docs/tableoperator/docs_17_05/ReadNOS.py +429 -429
- teradataml/data/docs/tableoperator/docs_17_05/WriteNOS.py +347 -347
- teradataml/data/docs/tableoperator/docs_17_10/ReadNOS.py +428 -428
- teradataml/data/docs/tableoperator/docs_17_10/WriteNOS.py +347 -347
- teradataml/data/docs/tableoperator/docs_17_20/ReadNOS.py +439 -439
- teradataml/data/docs/tableoperator/docs_17_20/WriteNOS.py +386 -386
- teradataml/data/docs/uaf/docs_17_20/ACF.py +195 -195
- teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +369 -369
- teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +142 -142
- teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +159 -159
- teradataml/data/docs/uaf/docs_17_20/BinaryMatrixOp.py +247 -247
- teradataml/data/docs/uaf/docs_17_20/BinarySeriesOp.py +252 -252
- teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +177 -177
- teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +174 -174
- teradataml/data/docs/uaf/docs_17_20/Convolve.py +226 -226
- teradataml/data/docs/uaf/docs_17_20/Convolve2.py +214 -214
- teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +183 -183
- teradataml/data/docs/uaf/docs_17_20/DFFT.py +203 -203
- teradataml/data/docs/uaf/docs_17_20/DFFT2.py +216 -216
- teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +215 -215
- teradataml/data/docs/uaf/docs_17_20/DFFTConv.py +191 -191
- teradataml/data/docs/uaf/docs_17_20/DTW.py +179 -179
- teradataml/data/docs/uaf/docs_17_20/DickeyFuller.py +144 -144
- teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +183 -183
- teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +184 -184
- teradataml/data/docs/uaf/docs_17_20/FitMetrics.py +172 -172
- teradataml/data/docs/uaf/docs_17_20/GenseriesFormula.py +205 -205
- teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +142 -142
- teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +258 -258
- teradataml/data/docs/uaf/docs_17_20/IDFFT.py +164 -164
- teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +198 -198
- teradataml/data/docs/uaf/docs_17_20/InputValidator.py +120 -120
- teradataml/data/docs/uaf/docs_17_20/LineSpec.py +155 -155
- teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +214 -214
- teradataml/data/docs/uaf/docs_17_20/MAMean.py +173 -173
- teradataml/data/docs/uaf/docs_17_20/MInfo.py +133 -133
- teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +135 -135
- teradataml/data/docs/uaf/docs_17_20/MultivarRegr.py +190 -190
- teradataml/data/docs/uaf/docs_17_20/PACF.py +158 -158
- teradataml/data/docs/uaf/docs_17_20/Portman.py +216 -216
- teradataml/data/docs/uaf/docs_17_20/PowerTransform.py +154 -154
- teradataml/data/docs/uaf/docs_17_20/Resample.py +228 -228
- teradataml/data/docs/uaf/docs_17_20/SInfo.py +122 -122
- teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +165 -165
- teradataml/data/docs/uaf/docs_17_20/SelectionCriteria.py +173 -173
- teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +170 -170
- teradataml/data/docs/uaf/docs_17_20/SignifResidmean.py +163 -163
- teradataml/data/docs/uaf/docs_17_20/SimpleExp.py +179 -179
- teradataml/data/docs/uaf/docs_17_20/Smoothma.py +207 -207
- teradataml/data/docs/uaf/docs_17_20/TrackingOp.py +150 -150
- teradataml/data/docs/uaf/docs_17_20/UNDIFF.py +171 -171
- teradataml/data/docs/uaf/docs_17_20/Unnormalize.py +201 -201
- teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +169 -169
- teradataml/data/dtw_example.json +17 -17
- teradataml/data/dtw_t1.csv +11 -11
- teradataml/data/dtw_t2.csv +4 -4
- teradataml/data/dwt2d_example.json +15 -15
- teradataml/data/dwt_example.json +14 -14
- teradataml/data/dwt_filter_dim.csv +5 -5
- teradataml/data/emission.csv +9 -9
- teradataml/data/emp_table_by_dept.csv +19 -19
- teradataml/data/employee_info.csv +4 -4
- teradataml/data/employee_table.csv +6 -6
- teradataml/data/excluding_event_table.csv +2 -2
- teradataml/data/finance_data.csv +6 -6
- teradataml/data/finance_data2.csv +61 -61
- teradataml/data/finance_data3.csv +93 -93
- teradataml/data/fish.csv +160 -0
- teradataml/data/fm_blood2ageandweight.csv +26 -26
- teradataml/data/fmeasure_example.json +11 -11
- teradataml/data/followers_leaders.csv +10 -10
- teradataml/data/fpgrowth_example.json +12 -12
- teradataml/data/frequentpaths_example.json +29 -29
- teradataml/data/friends.csv +9 -9
- teradataml/data/fs_input.csv +33 -33
- teradataml/data/fs_input1.csv +33 -33
- teradataml/data/genData.csv +513 -513
- teradataml/data/geodataframe_example.json +39 -39
- teradataml/data/glass_types.csv +215 -0
- teradataml/data/glm_admissions_model.csv +12 -12
- teradataml/data/glm_example.json +29 -29
- teradataml/data/glml1l2_example.json +28 -28
- teradataml/data/glml1l2predict_example.json +54 -54
- teradataml/data/glmpredict_example.json +54 -54
- teradataml/data/gq_t1.csv +21 -21
- teradataml/data/hconvolve_complex_right.csv +5 -5
- teradataml/data/hconvolve_complex_rightmulti.csv +5 -5
- teradataml/data/histogram_example.json +11 -11
- teradataml/data/hmmdecoder_example.json +78 -78
- teradataml/data/hmmevaluator_example.json +24 -24
- teradataml/data/hmmsupervised_example.json +10 -10
- teradataml/data/hmmunsupervised_example.json +7 -7
- teradataml/data/house_values.csv +12 -12
- teradataml/data/house_values2.csv +13 -13
- teradataml/data/housing_cat.csv +7 -7
- teradataml/data/housing_data.csv +9 -9
- teradataml/data/housing_test.csv +47 -47
- teradataml/data/housing_test_binary.csv +47 -47
- teradataml/data/housing_train.csv +493 -493
- teradataml/data/housing_train_attribute.csv +4 -4
- teradataml/data/housing_train_binary.csv +437 -437
- teradataml/data/housing_train_parameter.csv +2 -2
- teradataml/data/housing_train_response.csv +493 -493
- teradataml/data/ibm_stock.csv +370 -370
- teradataml/data/ibm_stock1.csv +370 -370
- teradataml/data/identitymatch_example.json +21 -21
- teradataml/data/idf_table.csv +4 -4
- teradataml/data/impressions.csv +101 -101
- teradataml/data/inflation.csv +21 -21
- teradataml/data/initial.csv +3 -3
- teradataml/data/insect_sprays.csv +12 -12
- teradataml/data/insurance.csv +1339 -1339
- teradataml/data/interpolator_example.json +12 -12
- teradataml/data/iris_altinput.csv +481 -481
- teradataml/data/iris_attribute_output.csv +8 -8
- teradataml/data/iris_attribute_test.csv +121 -121
- teradataml/data/iris_attribute_train.csv +481 -481
- teradataml/data/iris_category_expect_predict.csv +31 -31
- teradataml/data/iris_data.csv +151 -0
- teradataml/data/iris_input.csv +151 -151
- teradataml/data/iris_response_train.csv +121 -121
- teradataml/data/iris_test.csv +31 -31
- teradataml/data/iris_train.csv +121 -121
- teradataml/data/join_table1.csv +4 -4
- teradataml/data/join_table2.csv +4 -4
- teradataml/data/jsons/anly_function_name.json +6 -6
- teradataml/data/jsons/byom/dataikupredict.json +147 -147
- teradataml/data/jsons/byom/datarobotpredict.json +146 -146
- teradataml/data/jsons/byom/h2opredict.json +194 -194
- teradataml/data/jsons/byom/onnxpredict.json +186 -186
- teradataml/data/jsons/byom/pmmlpredict.json +146 -146
- teradataml/data/jsons/paired_functions.json +435 -435
- teradataml/data/jsons/sqle/16.20/Antiselect.json +56 -56
- teradataml/data/jsons/sqle/16.20/Attribution.json +249 -249
- teradataml/data/jsons/sqle/16.20/DecisionForestPredict.json +156 -156
- teradataml/data/jsons/sqle/16.20/DecisionTreePredict.json +170 -170
- teradataml/data/jsons/sqle/16.20/GLMPredict.json +122 -122
- teradataml/data/jsons/sqle/16.20/MovingAverage.json +367 -367
- teradataml/data/jsons/sqle/16.20/NGramSplitter.json +239 -239
- teradataml/data/jsons/sqle/16.20/NaiveBayesPredict.json +136 -136
- teradataml/data/jsons/sqle/16.20/NaiveBayesTextClassifierPredict.json +235 -235
- teradataml/data/jsons/sqle/16.20/Pack.json +98 -98
- teradataml/data/jsons/sqle/16.20/SVMSparsePredict.json +162 -162
- teradataml/data/jsons/sqle/16.20/Sessionize.json +105 -105
- teradataml/data/jsons/sqle/16.20/StringSimilarity.json +86 -86
- teradataml/data/jsons/sqle/16.20/Unpack.json +166 -166
- teradataml/data/jsons/sqle/16.20/nPath.json +269 -269
- teradataml/data/jsons/sqle/17.00/Antiselect.json +56 -56
- teradataml/data/jsons/sqle/17.00/Attribution.json +249 -249
- teradataml/data/jsons/sqle/17.00/DecisionForestPredict.json +156 -156
- teradataml/data/jsons/sqle/17.00/DecisionTreePredict.json +170 -170
- teradataml/data/jsons/sqle/17.00/GLMPredict.json +122 -122
- teradataml/data/jsons/sqle/17.00/MovingAverage.json +367 -367
- teradataml/data/jsons/sqle/17.00/NGramSplitter.json +239 -239
- teradataml/data/jsons/sqle/17.00/NaiveBayesPredict.json +136 -136
- teradataml/data/jsons/sqle/17.00/NaiveBayesTextClassifierPredict.json +235 -235
- teradataml/data/jsons/sqle/17.00/Pack.json +98 -98
- teradataml/data/jsons/sqle/17.00/SVMSparsePredict.json +162 -162
- teradataml/data/jsons/sqle/17.00/Sessionize.json +105 -105
- teradataml/data/jsons/sqle/17.00/StringSimilarity.json +86 -86
- teradataml/data/jsons/sqle/17.00/Unpack.json +166 -166
- teradataml/data/jsons/sqle/17.00/nPath.json +269 -269
- teradataml/data/jsons/sqle/17.05/Antiselect.json +56 -56
- teradataml/data/jsons/sqle/17.05/Attribution.json +249 -249
- teradataml/data/jsons/sqle/17.05/DecisionForestPredict.json +156 -156
- teradataml/data/jsons/sqle/17.05/DecisionTreePredict.json +170 -170
- teradataml/data/jsons/sqle/17.05/GLMPredict.json +122 -122
- teradataml/data/jsons/sqle/17.05/MovingAverage.json +367 -367
- teradataml/data/jsons/sqle/17.05/NGramSplitter.json +239 -239
- teradataml/data/jsons/sqle/17.05/NaiveBayesPredict.json +136 -136
- teradataml/data/jsons/sqle/17.05/NaiveBayesTextClassifierPredict.json +235 -235
- teradataml/data/jsons/sqle/17.05/Pack.json +98 -98
- teradataml/data/jsons/sqle/17.05/SVMSparsePredict.json +162 -162
- teradataml/data/jsons/sqle/17.05/Sessionize.json +105 -105
- teradataml/data/jsons/sqle/17.05/StringSimilarity.json +86 -86
- teradataml/data/jsons/sqle/17.05/Unpack.json +166 -166
- teradataml/data/jsons/sqle/17.05/nPath.json +269 -269
- teradataml/data/jsons/sqle/17.10/Antiselect.json +56 -56
- teradataml/data/jsons/sqle/17.10/Attribution.json +249 -249
- teradataml/data/jsons/sqle/17.10/DecisionForestPredict.json +185 -185
- teradataml/data/jsons/sqle/17.10/DecisionTreePredict.json +171 -171
- teradataml/data/jsons/sqle/17.10/GLMPredict.json +151 -151
- teradataml/data/jsons/sqle/17.10/MovingAverage.json +368 -368
- teradataml/data/jsons/sqle/17.10/NGramSplitter.json +239 -239
- teradataml/data/jsons/sqle/17.10/NaiveBayesPredict.json +149 -149
- teradataml/data/jsons/sqle/17.10/NaiveBayesTextClassifierPredict.json +288 -288
- teradataml/data/jsons/sqle/17.10/Pack.json +133 -133
- teradataml/data/jsons/sqle/17.10/SVMSparsePredict.json +193 -193
- teradataml/data/jsons/sqle/17.10/Sessionize.json +105 -105
- teradataml/data/jsons/sqle/17.10/StringSimilarity.json +86 -86
- teradataml/data/jsons/sqle/17.10/TD_BinCodeFit.json +239 -239
- teradataml/data/jsons/sqle/17.10/TD_BinCodeTransform.json +70 -70
- teradataml/data/jsons/sqle/17.10/TD_CategoricalSummary.json +53 -53
- teradataml/data/jsons/sqle/17.10/TD_Chisq.json +67 -67
- teradataml/data/jsons/sqle/17.10/TD_ColumnSummary.json +53 -53
- teradataml/data/jsons/sqle/17.10/TD_ConvertTo.json +68 -68
- teradataml/data/jsons/sqle/17.10/TD_FTest.json +187 -187
- teradataml/data/jsons/sqle/17.10/TD_FillRowID.json +51 -51
- teradataml/data/jsons/sqle/17.10/TD_FunctionFit.json +46 -46
- teradataml/data/jsons/sqle/17.10/TD_FunctionTransform.json +72 -71
- teradataml/data/jsons/sqle/17.10/TD_GetRowsWithMissingValues.json +52 -52
- teradataml/data/jsons/sqle/17.10/TD_GetRowsWithoutMissingValues.json +52 -52
- teradataml/data/jsons/sqle/17.10/TD_Histogram.json +132 -132
- teradataml/data/jsons/sqle/17.10/TD_NumApply.json +147 -147
- teradataml/data/jsons/sqle/17.10/TD_OneHotEncodingFit.json +182 -182
- teradataml/data/jsons/sqle/17.10/TD_OneHotEncodingTransform.json +65 -64
- teradataml/data/jsons/sqle/17.10/TD_OutlierFilterFit.json +196 -196
- teradataml/data/jsons/sqle/17.10/TD_OutlierFilterTransform.json +48 -47
- teradataml/data/jsons/sqle/17.10/TD_PolynomialFeaturesFit.json +114 -114
- teradataml/data/jsons/sqle/17.10/TD_PolynomialFeaturesTransform.json +72 -71
- teradataml/data/jsons/sqle/17.10/TD_QQNorm.json +111 -111
- teradataml/data/jsons/sqle/17.10/TD_RoundColumns.json +93 -93
- teradataml/data/jsons/sqle/17.10/TD_RowNormalizeFit.json +127 -127
- teradataml/data/jsons/sqle/17.10/TD_RowNormalizeTransform.json +70 -69
- teradataml/data/jsons/sqle/17.10/TD_ScaleFit.json +156 -156
- teradataml/data/jsons/sqle/17.10/TD_ScaleTransform.json +70 -69
- teradataml/data/jsons/sqle/17.10/TD_SimpleImputeFit.json +147 -147
- teradataml/data/jsons/sqle/17.10/TD_SimpleImputeTransform.json +48 -47
- teradataml/data/jsons/sqle/17.10/TD_StrApply.json +240 -240
- teradataml/data/jsons/sqle/17.10/TD_UnivariateStatistics.json +118 -118
- teradataml/data/jsons/sqle/17.10/TD_WhichMax.json +52 -52
- teradataml/data/jsons/sqle/17.10/TD_WhichMin.json +52 -52
- teradataml/data/jsons/sqle/17.10/TD_ZTest.json +171 -171
- teradataml/data/jsons/sqle/17.10/Unpack.json +188 -188
- teradataml/data/jsons/sqle/17.10/nPath.json +269 -269
- teradataml/data/jsons/sqle/17.20/Antiselect.json +56 -56
- teradataml/data/jsons/sqle/17.20/Attribution.json +249 -249
- teradataml/data/jsons/sqle/17.20/DecisionForestPredict.json +185 -185
- teradataml/data/jsons/sqle/17.20/DecisionTreePredict.json +172 -172
- teradataml/data/jsons/sqle/17.20/GLMPredict.json +151 -151
- teradataml/data/jsons/sqle/17.20/MovingAverage.json +367 -367
- teradataml/data/jsons/sqle/17.20/NGramSplitter.json +239 -239
- teradataml/data/jsons/sqle/17.20/NaiveBayesPredict.json +149 -149
- teradataml/data/jsons/sqle/17.20/NaiveBayesTextClassifierPredict.json +287 -287
- teradataml/data/jsons/sqle/17.20/Pack.json +133 -133
- teradataml/data/jsons/sqle/17.20/SVMSparsePredict.json +192 -192
- teradataml/data/jsons/sqle/17.20/Sessionize.json +105 -105
- teradataml/data/jsons/sqle/17.20/StringSimilarity.json +86 -86
- teradataml/data/jsons/sqle/17.20/TD_ANOVA.json +76 -76
- teradataml/data/jsons/sqle/17.20/TD_BinCodeFit.json +239 -239
- teradataml/data/jsons/sqle/17.20/TD_BinCodeTransform.json +71 -71
- teradataml/data/jsons/sqle/17.20/TD_CategoricalSummary.json +53 -53
- teradataml/data/jsons/sqle/17.20/TD_Chisq.json +67 -67
- teradataml/data/jsons/sqle/17.20/TD_ClassificationEvaluator.json +145 -145
- teradataml/data/jsons/sqle/17.20/TD_ColumnSummary.json +53 -53
- teradataml/data/jsons/sqle/17.20/TD_ColumnTransformer.json +218 -218
- teradataml/data/jsons/sqle/17.20/TD_ConvertTo.json +92 -92
- teradataml/data/jsons/sqle/17.20/TD_DecisionForest.json +259 -259
- teradataml/data/jsons/sqle/17.20/TD_DecisionForestPredict.json +139 -139
- teradataml/data/jsons/sqle/17.20/TD_FTest.json +186 -186
- teradataml/data/jsons/sqle/17.20/TD_FillRowID.json +52 -52
- teradataml/data/jsons/sqle/17.20/TD_FunctionFit.json +46 -46
- teradataml/data/jsons/sqle/17.20/TD_FunctionTransform.json +72 -72
- teradataml/data/jsons/sqle/17.20/TD_GLM.json +431 -431
- teradataml/data/jsons/sqle/17.20/TD_GLMPREDICT.json +125 -125
- teradataml/data/jsons/sqle/17.20/TD_GLMPerSegment.json +411 -411
- teradataml/data/jsons/sqle/17.20/TD_GLMPredictPerSegment.json +146 -146
- teradataml/data/jsons/sqle/17.20/TD_GetFutileColumns.json +91 -91
- teradataml/data/jsons/sqle/17.20/TD_GetRowsWithMissingValues.json +76 -76
- teradataml/data/jsons/sqle/17.20/TD_GetRowsWithoutMissingValues.json +76 -76
- teradataml/data/jsons/sqle/17.20/TD_Histogram.json +152 -152
- teradataml/data/jsons/sqle/17.20/TD_KMeans.json +211 -211
- teradataml/data/jsons/sqle/17.20/TD_KMeansPredict.json +86 -86
- teradataml/data/jsons/sqle/17.20/TD_KNN.json +262 -262
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayesTextClassifierTrainer.json +137 -137
- teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineFit.json +101 -101
- teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineTransform.json +71 -71
- teradataml/data/jsons/sqle/17.20/TD_NumApply.json +147 -147
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +315 -315
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVMPredict.json +123 -123
- teradataml/data/jsons/sqle/17.20/TD_OneHotEncodingFit.json +271 -271
- teradataml/data/jsons/sqle/17.20/TD_OneHotEncodingTransform.json +65 -65
- teradataml/data/jsons/sqle/17.20/TD_OrdinalEncodingFit.json +229 -229
- teradataml/data/jsons/sqle/17.20/TD_OrdinalEncodingTransform.json +75 -75
- teradataml/data/jsons/sqle/17.20/TD_OutlierFilterFit.json +217 -217
- teradataml/data/jsons/sqle/17.20/TD_OutlierFilterTransform.json +48 -48
- teradataml/data/jsons/sqle/17.20/TD_PolynomialFeaturesFit.json +114 -114
- teradataml/data/jsons/sqle/17.20/TD_PolynomialFeaturesTransform.json +72 -72
- teradataml/data/jsons/sqle/17.20/TD_QQNorm.json +111 -111
- teradataml/data/jsons/sqle/17.20/TD_ROC.json +177 -177
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionFit.json +178 -178
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionMinComponents.json +73 -73
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionTransform.json +74 -74
- teradataml/data/jsons/sqle/17.20/TD_RegressionEvaluator.json +137 -137
- teradataml/data/jsons/sqle/17.20/TD_RoundColumns.json +93 -93
- teradataml/data/jsons/sqle/17.20/TD_RowNormalizeFit.json +127 -127
- teradataml/data/jsons/sqle/17.20/TD_RowNormalizeTransform.json +70 -70
- teradataml/data/jsons/sqle/17.20/TD_SVM.json +389 -389
- teradataml/data/jsons/sqle/17.20/TD_SVMPredict.json +124 -124
- teradataml/data/jsons/sqle/17.20/TD_ScaleFit.json +156 -156
- teradataml/data/jsons/sqle/17.20/TD_ScaleTransform.json +70 -70
- teradataml/data/jsons/sqle/17.20/TD_SentimentExtractor.json +193 -193
- teradataml/data/jsons/sqle/17.20/TD_Silhouette.json +142 -142
- teradataml/data/jsons/sqle/17.20/TD_SimpleImputeFit.json +147 -147
- teradataml/data/jsons/sqle/17.20/TD_SimpleImputeTransform.json +48 -48
- teradataml/data/jsons/sqle/17.20/TD_StrApply.json +240 -240
- teradataml/data/jsons/sqle/17.20/TD_TargetEncodingFit.json +248 -248
- teradataml/data/jsons/sqle/17.20/TD_TargetEncodingTransform.json +75 -75
- teradataml/data/jsons/sqle/17.20/TD_TextParser.json +192 -192
- teradataml/data/jsons/sqle/17.20/TD_TrainTestSplit.json +142 -142
- teradataml/data/jsons/sqle/17.20/TD_UnivariateStatistics.json +117 -117
- teradataml/data/jsons/sqle/17.20/TD_VectorDistance.json +182 -182
- teradataml/data/jsons/sqle/17.20/TD_WhichMax.json +52 -52
- teradataml/data/jsons/sqle/17.20/TD_WhichMin.json +52 -52
- teradataml/data/jsons/sqle/17.20/TD_WordEmbeddings.json +241 -241
- teradataml/data/jsons/sqle/17.20/TD_XGBoost.json +312 -312
- teradataml/data/jsons/sqle/17.20/TD_XGBoostPredict.json +182 -182
- teradataml/data/jsons/sqle/17.20/TD_ZTest.json +170 -170
- teradataml/data/jsons/sqle/17.20/Unpack.json +188 -188
- teradataml/data/jsons/sqle/17.20/nPath.json +269 -269
- teradataml/data/jsons/tableoperator/17.00/read_nos.json +197 -197
- teradataml/data/jsons/tableoperator/17.05/read_nos.json +197 -197
- teradataml/data/jsons/tableoperator/17.05/write_nos.json +194 -194
- teradataml/data/jsons/tableoperator/17.10/read_nos.json +183 -183
- teradataml/data/jsons/tableoperator/17.10/write_nos.json +194 -194
- teradataml/data/jsons/tableoperator/17.20/read_nos.json +182 -182
- teradataml/data/jsons/tableoperator/17.20/write_nos.json +223 -223
- teradataml/data/jsons/uaf/17.20/TD_ACF.json +149 -149
- teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +409 -409
- teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +79 -79
- teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +151 -151
- teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +109 -109
- teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +107 -107
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +87 -87
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +106 -106
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +80 -80
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +67 -67
- teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +91 -91
- teradataml/data/jsons/uaf/17.20/TD_DFFT.json +136 -136
- teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +148 -148
- teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +108 -108
- teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +109 -109
- teradataml/data/jsons/uaf/17.20/TD_DICKEY_FULLER.json +86 -86
- teradataml/data/jsons/uaf/17.20/TD_DIFF.json +91 -91
- teradataml/data/jsons/uaf/17.20/TD_DTW.json +116 -116
- teradataml/data/jsons/uaf/17.20/TD_DURBIN_WATSON.json +100 -100
- teradataml/data/jsons/uaf/17.20/TD_EXTRACT_RESULTS.json +38 -38
- teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +100 -100
- teradataml/data/jsons/uaf/17.20/TD_GENSERIES4FORMULA.json +84 -84
- teradataml/data/jsons/uaf/17.20/TD_GENSERIES4SINUSOIDS.json +70 -70
- teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +152 -152
- teradataml/data/jsons/uaf/17.20/TD_HOLT_WINTERS_FORECAST.json +313 -313
- teradataml/data/jsons/uaf/17.20/TD_IDFFT.json +57 -57
- teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +94 -94
- teradataml/data/jsons/uaf/17.20/TD_INPUTVALIDATOR.json +63 -63
- teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +181 -181
- teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +102 -102
- teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +182 -182
- teradataml/data/jsons/uaf/17.20/TD_MATRIXMULTIPLY.json +67 -67
- teradataml/data/jsons/uaf/17.20/TD_MINFO.json +66 -66
- teradataml/data/jsons/uaf/17.20/TD_MULTIVAR_REGR.json +178 -178
- teradataml/data/jsons/uaf/17.20/TD_PACF.json +114 -114
- teradataml/data/jsons/uaf/17.20/TD_PORTMAN.json +118 -118
- teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +175 -175
- teradataml/data/jsons/uaf/17.20/TD_POWERTRANSFORM.json +97 -97
- teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +173 -173
- teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +136 -136
- teradataml/data/jsons/uaf/17.20/TD_SELECTION_CRITERIA.json +89 -89
- teradataml/data/jsons/uaf/17.20/TD_SIGNIF_PERIODICITIES.json +79 -79
- teradataml/data/jsons/uaf/17.20/TD_SIGNIF_RESIDMEAN.json +67 -67
- teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +184 -184
- teradataml/data/jsons/uaf/17.20/TD_SINFO.json +57 -57
- teradataml/data/jsons/uaf/17.20/TD_SMOOTHMA.json +162 -162
- teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +100 -100
- teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +111 -111
- teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +95 -95
- teradataml/data/jsons/uaf/17.20/TD_WHITES_GENERAL.json +77 -77
- teradataml/data/kmeans_example.json +17 -17
- teradataml/data/kmeans_us_arrests_data.csv +0 -0
- teradataml/data/knn_example.json +18 -18
- teradataml/data/knnrecommender_example.json +6 -6
- teradataml/data/knnrecommenderpredict_example.json +12 -12
- teradataml/data/lar_example.json +17 -17
- teradataml/data/larpredict_example.json +30 -30
- teradataml/data/lc_new_predictors.csv +5 -5
- teradataml/data/lc_new_reference.csv +9 -9
- teradataml/data/lda_example.json +8 -8
- teradataml/data/ldainference_example.json +14 -14
- teradataml/data/ldatopicsummary_example.json +8 -8
- teradataml/data/levendist_input.csv +13 -13
- teradataml/data/levenshteindistance_example.json +10 -10
- teradataml/data/linreg_example.json +9 -9
- teradataml/data/load_example_data.py +326 -323
- teradataml/data/loan_prediction.csv +295 -295
- teradataml/data/lungcancer.csv +138 -138
- teradataml/data/mappingdata.csv +12 -12
- teradataml/data/milk_timeseries.csv +157 -157
- teradataml/data/min_max_titanic.csv +4 -4
- teradataml/data/minhash_example.json +6 -6
- teradataml/data/ml_ratings.csv +7547 -7547
- teradataml/data/ml_ratings_10.csv +2445 -2445
- teradataml/data/model1_table.csv +5 -5
- teradataml/data/model2_table.csv +5 -5
- teradataml/data/models/iris_db_glm_model.pmml +56 -56
- teradataml/data/models/iris_db_xgb_model.pmml +4471 -4471
- teradataml/data/modularity_example.json +12 -12
- teradataml/data/movavg_example.json +7 -7
- teradataml/data/mtx1.csv +7 -7
- teradataml/data/mtx2.csv +13 -13
- teradataml/data/multi_model_classification.csv +401 -0
- teradataml/data/multi_model_regression.csv +401 -0
- teradataml/data/mvdfft8.csv +9 -9
- teradataml/data/naivebayes_example.json +9 -9
- teradataml/data/naivebayespredict_example.json +19 -19
- teradataml/data/naivebayestextclassifier2_example.json +6 -6
- teradataml/data/naivebayestextclassifier_example.json +8 -8
- teradataml/data/naivebayestextclassifierpredict_example.json +20 -20
- teradataml/data/name_Find_configure.csv +10 -10
- teradataml/data/namedentityfinder_example.json +14 -14
- teradataml/data/namedentityfinderevaluator_example.json +10 -10
- teradataml/data/namedentityfindertrainer_example.json +6 -6
- teradataml/data/nb_iris_input_test.csv +31 -31
- teradataml/data/nb_iris_input_train.csv +121 -121
- teradataml/data/nbp_iris_model.csv +13 -13
- teradataml/data/ner_extractor_text.csv +2 -2
- teradataml/data/ner_sports_test2.csv +29 -29
- teradataml/data/ner_sports_train.csv +501 -501
- teradataml/data/nerevaluator_example.json +5 -5
- teradataml/data/nerextractor_example.json +18 -18
- teradataml/data/nermem_sports_test.csv +17 -17
- teradataml/data/nermem_sports_train.csv +50 -50
- teradataml/data/nertrainer_example.json +6 -6
- teradataml/data/ngrams_example.json +6 -6
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Aggregate Functions using SQLAlchemy.ipynb +1455 -1455
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Arithmetic Functions Using SQLAlchemy.ipynb +1993 -1993
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Bit-Byte Manipulation Functions using SQLAlchemy.ipynb +1492 -1492
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Built-in functions using SQLAlchemy.ipynb +536 -536
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Regular Expressions Using SQLAlchemy.ipynb +570 -570
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage String Functions Using SQLAlchemy.ipynb +2559 -2559
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Window Aggregate Functions using SQLAlchemy.ipynb +2911 -2911
- teradataml/data/notebooks/sqlalchemy/Using Generic SQLAlchemy ClauseElements teradataml DataFrame assign method.ipynb +698 -698
- teradataml/data/notebooks/sqlalchemy/teradataml filtering using SQLAlchemy ClauseElements.ipynb +784 -784
- teradataml/data/npath_example.json +23 -23
- teradataml/data/ntree_example.json +14 -14
- teradataml/data/numeric_strings.csv +4 -4
- teradataml/data/numerics.csv +4 -4
- teradataml/data/ocean_buoy.csv +17 -17
- teradataml/data/ocean_buoy2.csv +17 -17
- teradataml/data/ocean_buoys.csv +27 -27
- teradataml/data/ocean_buoys2.csv +10 -10
- teradataml/data/ocean_buoys_nonpti.csv +28 -28
- teradataml/data/ocean_buoys_seq.csv +29 -29
- teradataml/data/openml_example.json +63 -0
- teradataml/data/optional_event_table.csv +4 -4
- teradataml/data/orders1.csv +11 -11
- teradataml/data/orders1_12.csv +12 -12
- teradataml/data/orders_ex.csv +4 -4
- teradataml/data/pack_example.json +8 -8
- teradataml/data/package_tracking.csv +19 -19
- teradataml/data/package_tracking_pti.csv +18 -18
- teradataml/data/pagerank_example.json +13 -13
- teradataml/data/paragraphs_input.csv +6 -6
- teradataml/data/pathanalyzer_example.json +7 -7
- teradataml/data/pathgenerator_example.json +7 -7
- teradataml/data/phrases.csv +7 -7
- teradataml/data/pivot_example.json +8 -8
- teradataml/data/pivot_input.csv +22 -22
- teradataml/data/playerRating.csv +31 -31
- teradataml/data/postagger_example.json +6 -6
- teradataml/data/posttagger_output.csv +44 -44
- teradataml/data/production_data.csv +16 -16
- teradataml/data/production_data2.csv +7 -7
- teradataml/data/randomsample_example.json +31 -31
- teradataml/data/randomwalksample_example.json +8 -8
- teradataml/data/rank_table.csv +6 -6
- teradataml/data/ref_mobile_data.csv +4 -4
- teradataml/data/ref_mobile_data_dense.csv +2 -2
- teradataml/data/ref_url.csv +17 -17
- teradataml/data/restaurant_reviews.csv +7 -7
- teradataml/data/river_data.csv +145 -145
- teradataml/data/roc_example.json +7 -7
- teradataml/data/roc_input.csv +101 -101
- teradataml/data/rule_inputs.csv +6 -6
- teradataml/data/rule_table.csv +2 -2
- teradataml/data/sales.csv +7 -7
- teradataml/data/sales_transaction.csv +501 -501
- teradataml/data/salesdata.csv +342 -342
- teradataml/data/sample_cities.csv +2 -2
- teradataml/data/sample_shapes.csv +10 -10
- teradataml/data/sample_streets.csv +2 -2
- teradataml/data/sampling_example.json +15 -15
- teradataml/data/sax_example.json +8 -8
- teradataml/data/scale_example.json +23 -23
- teradataml/data/scale_housing.csv +11 -11
- teradataml/data/scale_housing_test.csv +6 -6
- teradataml/data/scale_stat.csv +11 -11
- teradataml/data/scalebypartition_example.json +13 -13
- teradataml/data/scalemap_example.json +13 -13
- teradataml/data/scalesummary_example.json +12 -12
- teradataml/data/score_category.csv +101 -101
- teradataml/data/score_summary.csv +4 -4
- teradataml/data/script_example.json +9 -9
- teradataml/data/scripts/deploy_script.py +65 -0
- teradataml/data/scripts/mapper.R +20 -0
- teradataml/data/scripts/mapper.py +15 -15
- teradataml/data/scripts/mapper_replace.py +15 -15
- teradataml/data/scripts/sklearn/__init__.py +0 -0
- teradataml/data/scripts/sklearn/sklearn_fit.py +175 -0
- teradataml/data/scripts/sklearn/sklearn_fit_predict.py +135 -0
- teradataml/data/scripts/sklearn/sklearn_function.template +113 -0
- teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +158 -0
- teradataml/data/scripts/sklearn/sklearn_neighbors.py +152 -0
- teradataml/data/scripts/sklearn/sklearn_score.py +128 -0
- teradataml/data/scripts/sklearn/sklearn_transform.py +179 -0
- teradataml/data/seeds.csv +10 -10
- teradataml/data/sentenceextractor_example.json +6 -6
- teradataml/data/sentiment_extract_input.csv +11 -11
- teradataml/data/sentiment_train.csv +16 -16
- teradataml/data/sentiment_word.csv +20 -20
- teradataml/data/sentiment_word_input.csv +19 -19
- teradataml/data/sentimentextractor_example.json +24 -24
- teradataml/data/sentimenttrainer_example.json +8 -8
- teradataml/data/sequence_table.csv +10 -10
- teradataml/data/seriessplitter_example.json +7 -7
- teradataml/data/sessionize_example.json +17 -17
- teradataml/data/sessionize_table.csv +116 -116
- teradataml/data/setop_test1.csv +24 -24
- teradataml/data/setop_test2.csv +22 -22
- teradataml/data/soc_nw_edges.csv +10 -10
- teradataml/data/soc_nw_vertices.csv +7 -7
- teradataml/data/souvenir_timeseries.csv +167 -167
- teradataml/data/sparse_iris_attribute.csv +5 -5
- teradataml/data/sparse_iris_test.csv +121 -121
- teradataml/data/sparse_iris_train.csv +601 -601
- teradataml/data/star1.csv +6 -6
- teradataml/data/state_transition.csv +5 -5
- teradataml/data/stock_data.csv +53 -53
- teradataml/data/stock_movement.csv +11 -11
- teradataml/data/stock_vol.csv +76 -76
- teradataml/data/stop_words.csv +8 -8
- teradataml/data/store_sales.csv +37 -37
- teradataml/data/stringsimilarity_example.json +7 -7
- teradataml/data/strsimilarity_input.csv +13 -13
- teradataml/data/students.csv +101 -101
- teradataml/data/svm_iris_input_test.csv +121 -121
- teradataml/data/svm_iris_input_train.csv +481 -481
- teradataml/data/svm_iris_model.csv +7 -7
- teradataml/data/svmdense_example.json +9 -9
- teradataml/data/svmdensepredict_example.json +18 -18
- teradataml/data/svmsparse_example.json +7 -7
- teradataml/data/svmsparsepredict_example.json +13 -13
- teradataml/data/svmsparsesummary_example.json +7 -7
- teradataml/data/target_mobile_data.csv +13 -13
- teradataml/data/target_mobile_data_dense.csv +5 -5
- teradataml/data/templatedata.csv +1201 -1201
- teradataml/data/templates/open_source_ml.json +9 -0
- teradataml/data/teradataml_example.json +73 -1
- teradataml/data/test_classification.csv +101 -0
- teradataml/data/test_loan_prediction.csv +53 -53
- teradataml/data/test_pacf_12.csv +37 -37
- teradataml/data/test_prediction.csv +101 -0
- teradataml/data/test_regression.csv +101 -0
- teradataml/data/test_river2.csv +109 -109
- teradataml/data/text_inputs.csv +6 -6
- teradataml/data/textchunker_example.json +7 -7
- teradataml/data/textclassifier_example.json +6 -6
- teradataml/data/textclassifier_input.csv +7 -7
- teradataml/data/textclassifiertrainer_example.json +6 -6
- teradataml/data/textmorph_example.json +5 -5
- teradataml/data/textparser_example.json +15 -15
- teradataml/data/texttagger_example.json +11 -11
- teradataml/data/texttokenizer_example.json +6 -6
- teradataml/data/texttrainer_input.csv +11 -11
- teradataml/data/tf_example.json +6 -6
- teradataml/data/tfidf_example.json +13 -13
- teradataml/data/tfidf_input1.csv +201 -201
- teradataml/data/tfidf_train.csv +6 -6
- teradataml/data/time_table1.csv +535 -535
- teradataml/data/time_table2.csv +14 -14
- teradataml/data/timeseriesdata.csv +1601 -1601
- teradataml/data/timeseriesdatasetsd4.csv +105 -105
- teradataml/data/titanic.csv +892 -892
- teradataml/data/token_table.csv +696 -696
- teradataml/data/train_multiclass.csv +101 -0
- teradataml/data/train_regression.csv +101 -0
- teradataml/data/train_regression_multiple_labels.csv +101 -0
- teradataml/data/train_tracking.csv +27 -27
- teradataml/data/transformation_table.csv +5 -5
- teradataml/data/transformation_table_new.csv +1 -1
- teradataml/data/tv_spots.csv +16 -16
- teradataml/data/twod_climate_data.csv +117 -117
- teradataml/data/uaf_example.json +475 -475
- teradataml/data/univariatestatistics_example.json +8 -8
- teradataml/data/unpack_example.json +9 -9
- teradataml/data/unpivot_example.json +9 -9
- teradataml/data/unpivot_input.csv +8 -8
- teradataml/data/us_air_pass.csv +36 -36
- teradataml/data/us_population.csv +624 -624
- teradataml/data/us_states_shapes.csv +52 -52
- teradataml/data/varmax_example.json +17 -17
- teradataml/data/vectordistance_example.json +25 -25
- teradataml/data/ville_climatedata.csv +121 -121
- teradataml/data/ville_tempdata.csv +12 -12
- teradataml/data/ville_tempdata1.csv +12 -12
- teradataml/data/ville_temperature.csv +11 -11
- teradataml/data/waveletTable.csv +1605 -1605
- teradataml/data/waveletTable2.csv +1605 -1605
- teradataml/data/weightedmovavg_example.json +8 -8
- teradataml/data/wft_testing.csv +5 -5
- teradataml/data/wine_data.csv +1600 -0
- teradataml/data/word_embed_input_table1.csv +5 -5
- teradataml/data/word_embed_input_table2.csv +4 -4
- teradataml/data/word_embed_model.csv +22 -22
- teradataml/data/words_input.csv +13 -13
- teradataml/data/xconvolve_complex_left.csv +6 -6
- teradataml/data/xconvolve_complex_leftmulti.csv +6 -6
- teradataml/data/xgboost_example.json +35 -35
- teradataml/data/xgboostpredict_example.json +31 -31
- teradataml/dataframe/copy_to.py +1764 -1698
- teradataml/dataframe/data_transfer.py +2753 -2745
- teradataml/dataframe/dataframe.py +17545 -16946
- teradataml/dataframe/dataframe_utils.py +1837 -1740
- teradataml/dataframe/fastload.py +611 -603
- teradataml/dataframe/indexer.py +424 -424
- teradataml/dataframe/setop.py +1179 -1166
- teradataml/dataframe/sql.py +10090 -6432
- teradataml/dataframe/sql_function_parameters.py +439 -388
- teradataml/dataframe/sql_functions.py +652 -652
- teradataml/dataframe/sql_interfaces.py +220 -220
- teradataml/dataframe/vantage_function_types.py +674 -630
- teradataml/dataframe/window.py +693 -692
- teradataml/dbutils/__init__.py +3 -3
- teradataml/dbutils/dbutils.py +1167 -1150
- teradataml/dbutils/filemgr.py +267 -267
- teradataml/gen_ai/__init__.py +2 -2
- teradataml/gen_ai/convAI.py +472 -472
- teradataml/geospatial/__init__.py +3 -3
- teradataml/geospatial/geodataframe.py +1105 -1094
- teradataml/geospatial/geodataframecolumn.py +392 -387
- teradataml/geospatial/geometry_types.py +925 -925
- teradataml/hyperparameter_tuner/__init__.py +1 -1
- teradataml/hyperparameter_tuner/optimizer.py +3783 -2993
- teradataml/hyperparameter_tuner/utils.py +281 -187
- 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/libaed_0_1.dylib +0 -0
- teradataml/libaed_0_1.so +0 -0
- teradataml/opensource/__init__.py +1 -0
- teradataml/opensource/sklearn/__init__.py +1 -0
- teradataml/opensource/sklearn/_class.py +255 -0
- teradataml/opensource/sklearn/_sklearn_wrapper.py +1668 -0
- teradataml/opensource/sklearn/_wrapper_utils.py +268 -0
- teradataml/opensource/sklearn/constants.py +54 -0
- teradataml/options/__init__.py +121 -124
- teradataml/options/configure.py +337 -336
- teradataml/options/display.py +176 -176
- teradataml/plot/__init__.py +2 -2
- teradataml/plot/axis.py +1388 -1388
- teradataml/plot/constants.py +15 -15
- teradataml/plot/figure.py +398 -398
- teradataml/plot/plot.py +760 -760
- teradataml/plot/query_generator.py +83 -83
- teradataml/plot/subplot.py +216 -216
- teradataml/scriptmgmt/UserEnv.py +3788 -3761
- teradataml/scriptmgmt/__init__.py +3 -3
- teradataml/scriptmgmt/lls_utils.py +1616 -1604
- teradataml/series/series.py +532 -532
- teradataml/series/series_utils.py +71 -71
- teradataml/table_operators/Apply.py +949 -917
- teradataml/table_operators/Script.py +1719 -1982
- teradataml/table_operators/TableOperator.py +1207 -1616
- teradataml/table_operators/__init__.py +2 -3
- teradataml/table_operators/apply_query_generator.py +262 -262
- teradataml/table_operators/query_generator.py +507 -507
- teradataml/table_operators/table_operator_query_generator.py +460 -460
- teradataml/table_operators/table_operator_util.py +631 -639
- teradataml/table_operators/templates/dataframe_apply.template +184 -184
- teradataml/table_operators/templates/dataframe_map.template +176 -176
- teradataml/table_operators/templates/script_executor.template +170 -170
- teradataml/utils/dtypes.py +684 -684
- teradataml/utils/internal_buffer.py +84 -84
- teradataml/utils/print_versions.py +205 -205
- teradataml/utils/utils.py +410 -410
- teradataml/utils/validators.py +2239 -2115
- {teradataml-17.20.0.7.dist-info → teradataml-20.0.0.0.dist-info}/METADATA +270 -41
- teradataml-20.0.0.0.dist-info/RECORD +1038 -0
- {teradataml-17.20.0.7.dist-info → teradataml-20.0.0.0.dist-info}/WHEEL +1 -1
- {teradataml-17.20.0.7.dist-info → teradataml-20.0.0.0.dist-info}/zip-safe +1 -1
- teradataml/analytics/mle/AdaBoost.py +0 -651
- teradataml/analytics/mle/AdaBoostPredict.py +0 -564
- teradataml/analytics/mle/Antiselect.py +0 -342
- teradataml/analytics/mle/Arima.py +0 -641
- teradataml/analytics/mle/ArimaPredict.py +0 -477
- teradataml/analytics/mle/Attribution.py +0 -1070
- teradataml/analytics/mle/Betweenness.py +0 -658
- teradataml/analytics/mle/Burst.py +0 -711
- teradataml/analytics/mle/CCM.py +0 -600
- teradataml/analytics/mle/CCMPrepare.py +0 -324
- teradataml/analytics/mle/CFilter.py +0 -460
- teradataml/analytics/mle/ChangePointDetection.py +0 -572
- teradataml/analytics/mle/ChangePointDetectionRT.py +0 -477
- teradataml/analytics/mle/Closeness.py +0 -737
- teradataml/analytics/mle/ConfusionMatrix.py +0 -420
- teradataml/analytics/mle/Correlation.py +0 -477
- teradataml/analytics/mle/Correlation2.py +0 -573
- teradataml/analytics/mle/CoxHazardRatio.py +0 -679
- teradataml/analytics/mle/CoxPH.py +0 -556
- teradataml/analytics/mle/CoxSurvival.py +0 -478
- teradataml/analytics/mle/CumulativeMovAvg.py +0 -363
- teradataml/analytics/mle/DTW.py +0 -623
- teradataml/analytics/mle/DWT.py +0 -564
- teradataml/analytics/mle/DWT2D.py +0 -599
- teradataml/analytics/mle/DecisionForest.py +0 -716
- teradataml/analytics/mle/DecisionForestEvaluator.py +0 -363
- teradataml/analytics/mle/DecisionForestPredict.py +0 -561
- teradataml/analytics/mle/DecisionTree.py +0 -830
- teradataml/analytics/mle/DecisionTreePredict.py +0 -528
- teradataml/analytics/mle/ExponentialMovAvg.py +0 -418
- teradataml/analytics/mle/FMeasure.py +0 -402
- teradataml/analytics/mle/FPGrowth.py +0 -734
- teradataml/analytics/mle/FrequentPaths.py +0 -695
- teradataml/analytics/mle/GLM.py +0 -558
- teradataml/analytics/mle/GLML1L2.py +0 -547
- teradataml/analytics/mle/GLML1L2Predict.py +0 -519
- teradataml/analytics/mle/GLMPredict.py +0 -529
- teradataml/analytics/mle/HMMDecoder.py +0 -945
- teradataml/analytics/mle/HMMEvaluator.py +0 -901
- teradataml/analytics/mle/HMMSupervised.py +0 -521
- teradataml/analytics/mle/HMMUnsupervised.py +0 -572
- teradataml/analytics/mle/Histogram.py +0 -561
- teradataml/analytics/mle/IDWT.py +0 -476
- teradataml/analytics/mle/IDWT2D.py +0 -493
- teradataml/analytics/mle/IdentityMatch.py +0 -763
- teradataml/analytics/mle/Interpolator.py +0 -918
- teradataml/analytics/mle/KMeans.py +0 -485
- teradataml/analytics/mle/KNN.py +0 -627
- teradataml/analytics/mle/KNNRecommender.py +0 -488
- teradataml/analytics/mle/KNNRecommenderPredict.py +0 -581
- teradataml/analytics/mle/LAR.py +0 -439
- teradataml/analytics/mle/LARPredict.py +0 -478
- teradataml/analytics/mle/LDA.py +0 -548
- teradataml/analytics/mle/LDAInference.py +0 -492
- teradataml/analytics/mle/LDATopicSummary.py +0 -464
- teradataml/analytics/mle/LevenshteinDistance.py +0 -450
- teradataml/analytics/mle/LinReg.py +0 -433
- teradataml/analytics/mle/LinRegPredict.py +0 -438
- teradataml/analytics/mle/MinHash.py +0 -544
- teradataml/analytics/mle/Modularity.py +0 -587
- teradataml/analytics/mle/NEREvaluator.py +0 -410
- teradataml/analytics/mle/NERExtractor.py +0 -595
- teradataml/analytics/mle/NERTrainer.py +0 -458
- teradataml/analytics/mle/NGrams.py +0 -570
- teradataml/analytics/mle/NPath.py +0 -634
- teradataml/analytics/mle/NTree.py +0 -549
- teradataml/analytics/mle/NaiveBayes.py +0 -462
- teradataml/analytics/mle/NaiveBayesPredict.py +0 -513
- teradataml/analytics/mle/NaiveBayesTextClassifier.py +0 -607
- teradataml/analytics/mle/NaiveBayesTextClassifier2.py +0 -531
- teradataml/analytics/mle/NaiveBayesTextClassifierPredict.py +0 -799
- teradataml/analytics/mle/NamedEntityFinder.py +0 -529
- teradataml/analytics/mle/NamedEntityFinderEvaluator.py +0 -414
- teradataml/analytics/mle/NamedEntityFinderTrainer.py +0 -396
- teradataml/analytics/mle/POSTagger.py +0 -417
- teradataml/analytics/mle/Pack.py +0 -411
- teradataml/analytics/mle/PageRank.py +0 -535
- teradataml/analytics/mle/PathAnalyzer.py +0 -426
- teradataml/analytics/mle/PathGenerator.py +0 -367
- teradataml/analytics/mle/PathStart.py +0 -464
- teradataml/analytics/mle/PathSummarizer.py +0 -470
- teradataml/analytics/mle/Pivot.py +0 -471
- teradataml/analytics/mle/ROC.py +0 -425
- teradataml/analytics/mle/RandomSample.py +0 -637
- teradataml/analytics/mle/RandomWalkSample.py +0 -490
- teradataml/analytics/mle/SAX.py +0 -779
- teradataml/analytics/mle/SVMDense.py +0 -677
- teradataml/analytics/mle/SVMDensePredict.py +0 -536
- teradataml/analytics/mle/SVMDenseSummary.py +0 -437
- teradataml/analytics/mle/SVMSparse.py +0 -557
- teradataml/analytics/mle/SVMSparsePredict.py +0 -553
- teradataml/analytics/mle/SVMSparseSummary.py +0 -435
- teradataml/analytics/mle/Sampling.py +0 -549
- teradataml/analytics/mle/Scale.py +0 -565
- teradataml/analytics/mle/ScaleByPartition.py +0 -496
- teradataml/analytics/mle/ScaleMap.py +0 -378
- teradataml/analytics/mle/ScaleSummary.py +0 -320
- teradataml/analytics/mle/SentenceExtractor.py +0 -363
- teradataml/analytics/mle/SentimentEvaluator.py +0 -432
- teradataml/analytics/mle/SentimentExtractor.py +0 -578
- teradataml/analytics/mle/SentimentTrainer.py +0 -405
- teradataml/analytics/mle/SeriesSplitter.py +0 -641
- teradataml/analytics/mle/Sessionize.py +0 -475
- teradataml/analytics/mle/SimpleMovAvg.py +0 -397
- teradataml/analytics/mle/StringSimilarity.py +0 -425
- teradataml/analytics/mle/TF.py +0 -389
- teradataml/analytics/mle/TFIDF.py +0 -504
- teradataml/analytics/mle/TextChunker.py +0 -414
- teradataml/analytics/mle/TextClassifier.py +0 -399
- teradataml/analytics/mle/TextClassifierEvaluator.py +0 -413
- teradataml/analytics/mle/TextClassifierTrainer.py +0 -565
- teradataml/analytics/mle/TextMorph.py +0 -494
- teradataml/analytics/mle/TextParser.py +0 -623
- teradataml/analytics/mle/TextTagger.py +0 -530
- teradataml/analytics/mle/TextTokenizer.py +0 -502
- teradataml/analytics/mle/UnivariateStatistics.py +0 -488
- teradataml/analytics/mle/Unpack.py +0 -526
- teradataml/analytics/mle/Unpivot.py +0 -438
- teradataml/analytics/mle/VarMax.py +0 -776
- teradataml/analytics/mle/VectorDistance.py +0 -762
- teradataml/analytics/mle/WeightedMovAvg.py +0 -400
- teradataml/analytics/mle/XGBoost.py +0 -842
- teradataml/analytics/mle/XGBoostPredict.py +0 -627
- teradataml/analytics/mle/__init__.py +0 -123
- teradataml/analytics/mle/json/adaboost_mle.json +0 -135
- teradataml/analytics/mle/json/adaboostpredict_mle.json +0 -85
- teradataml/analytics/mle/json/antiselect_mle.json +0 -34
- teradataml/analytics/mle/json/antiselect_mle_mle.json +0 -34
- teradataml/analytics/mle/json/arima_mle.json +0 -172
- teradataml/analytics/mle/json/arimapredict_mle.json +0 -52
- teradataml/analytics/mle/json/attribution_mle_mle.json +0 -143
- teradataml/analytics/mle/json/betweenness_mle.json +0 -97
- teradataml/analytics/mle/json/burst_mle.json +0 -140
- teradataml/analytics/mle/json/ccm_mle.json +0 -124
- teradataml/analytics/mle/json/ccmprepare_mle.json +0 -14
- teradataml/analytics/mle/json/cfilter_mle.json +0 -93
- teradataml/analytics/mle/json/changepointdetection_mle.json +0 -92
- teradataml/analytics/mle/json/changepointdetectionrt_mle.json +0 -78
- teradataml/analytics/mle/json/closeness_mle.json +0 -104
- teradataml/analytics/mle/json/confusionmatrix_mle.json +0 -79
- teradataml/analytics/mle/json/correlation_mle.json +0 -86
- teradataml/analytics/mle/json/correlationreduce_mle.json +0 -49
- teradataml/analytics/mle/json/coxhazardratio_mle.json +0 -89
- teradataml/analytics/mle/json/coxph_mle.json +0 -98
- teradataml/analytics/mle/json/coxsurvival_mle.json +0 -79
- teradataml/analytics/mle/json/cumulativemovavg_mle.json +0 -34
- teradataml/analytics/mle/json/decisionforest_mle.json +0 -167
- teradataml/analytics/mle/json/decisionforestevaluator_mle.json +0 -33
- teradataml/analytics/mle/json/decisionforestpredict_mle_mle.json +0 -74
- teradataml/analytics/mle/json/decisiontree_mle.json +0 -194
- teradataml/analytics/mle/json/decisiontreepredict_mle_mle.json +0 -86
- teradataml/analytics/mle/json/dtw_mle.json +0 -97
- teradataml/analytics/mle/json/dwt2d_mle.json +0 -116
- teradataml/analytics/mle/json/dwt_mle.json +0 -101
- teradataml/analytics/mle/json/exponentialmovavg_mle.json +0 -55
- teradataml/analytics/mle/json/fmeasure_mle.json +0 -58
- teradataml/analytics/mle/json/fpgrowth_mle.json +0 -159
- teradataml/analytics/mle/json/frequentpaths_mle.json +0 -129
- teradataml/analytics/mle/json/glm_mle.json +0 -111
- teradataml/analytics/mle/json/glml1l2_mle.json +0 -106
- teradataml/analytics/mle/json/glml1l2predict_mle.json +0 -57
- teradataml/analytics/mle/json/glmpredict_mle_mle.json +0 -74
- teradataml/analytics/mle/json/histogram_mle.json +0 -100
- teradataml/analytics/mle/json/hmmdecoder_mle.json +0 -192
- teradataml/analytics/mle/json/hmmevaluator_mle.json +0 -206
- teradataml/analytics/mle/json/hmmsupervised_mle.json +0 -91
- teradataml/analytics/mle/json/hmmunsupervised_mle.json +0 -114
- teradataml/analytics/mle/json/identitymatch_mle.json +0 -88
- teradataml/analytics/mle/json/idwt2d_mle.json +0 -73
- teradataml/analytics/mle/json/idwt_mle.json +0 -66
- teradataml/analytics/mle/json/interpolator_mle.json +0 -151
- teradataml/analytics/mle/json/kmeans_mle.json +0 -97
- teradataml/analytics/mle/json/knn_mle.json +0 -141
- teradataml/analytics/mle/json/knnrecommender_mle.json +0 -111
- teradataml/analytics/mle/json/knnrecommenderpredict_mle.json +0 -75
- teradataml/analytics/mle/json/lar_mle.json +0 -78
- teradataml/analytics/mle/json/larpredict_mle.json +0 -69
- teradataml/analytics/mle/json/lda_mle.json +0 -130
- teradataml/analytics/mle/json/ldainference_mle.json +0 -78
- teradataml/analytics/mle/json/ldatopicsummary_mle.json +0 -64
- teradataml/analytics/mle/json/levenshteindistance_mle.json +0 -92
- teradataml/analytics/mle/json/linreg_mle.json +0 -42
- teradataml/analytics/mle/json/linregpredict_mle.json +0 -56
- teradataml/analytics/mle/json/minhash_mle.json +0 -113
- teradataml/analytics/mle/json/modularity_mle.json +0 -91
- teradataml/analytics/mle/json/naivebayespredict_mle_mle.json +0 -85
- teradataml/analytics/mle/json/naivebayesreduce_mle.json +0 -52
- teradataml/analytics/mle/json/naivebayestextclassifierpredict_mle_mle.json +0 -147
- teradataml/analytics/mle/json/naivebayestextclassifiertrainer2_mle.json +0 -108
- teradataml/analytics/mle/json/naivebayestextclassifiertrainer_mle.json +0 -102
- teradataml/analytics/mle/json/namedentityfinder_mle.json +0 -84
- teradataml/analytics/mle/json/namedentityfinderevaluatorreduce_mle.json +0 -43
- teradataml/analytics/mle/json/namedentityfindertrainer_mle.json +0 -64
- teradataml/analytics/mle/json/nerevaluator_mle.json +0 -54
- teradataml/analytics/mle/json/nerextractor_mle.json +0 -87
- teradataml/analytics/mle/json/nertrainer_mle.json +0 -89
- teradataml/analytics/mle/json/ngrams_mle.json +0 -137
- teradataml/analytics/mle/json/ngramsplitter_mle_mle.json +0 -137
- teradataml/analytics/mle/json/npath@coprocessor_mle.json +0 -73
- teradataml/analytics/mle/json/ntree@coprocessor_mle.json +0 -123
- teradataml/analytics/mle/json/pack_mle.json +0 -58
- teradataml/analytics/mle/json/pack_mle_mle.json +0 -58
- teradataml/analytics/mle/json/pagerank_mle.json +0 -81
- teradataml/analytics/mle/json/pathanalyzer_mle.json +0 -63
- teradataml/analytics/mle/json/pathgenerator_mle.json +0 -40
- teradataml/analytics/mle/json/pathstart_mle.json +0 -62
- teradataml/analytics/mle/json/pathsummarizer_mle.json +0 -72
- teradataml/analytics/mle/json/pivoting_mle.json +0 -71
- teradataml/analytics/mle/json/postagger_mle.json +0 -51
- teradataml/analytics/mle/json/randomsample_mle.json +0 -131
- teradataml/analytics/mle/json/randomwalksample_mle.json +0 -85
- teradataml/analytics/mle/json/roc_mle.json +0 -73
- teradataml/analytics/mle/json/sampling_mle.json +0 -75
- teradataml/analytics/mle/json/sax_mle.json +0 -154
- teradataml/analytics/mle/json/scale_mle.json +0 -93
- teradataml/analytics/mle/json/scalebypartition_mle.json +0 -89
- teradataml/analytics/mle/json/scalemap_mle.json +0 -44
- teradataml/analytics/mle/json/scalesummary_mle.json +0 -14
- teradataml/analytics/mle/json/sentenceextractor_mle.json +0 -41
- teradataml/analytics/mle/json/sentimentevaluator_mle.json +0 -43
- teradataml/analytics/mle/json/sentimentextractor_mle.json +0 -100
- teradataml/analytics/mle/json/sentimenttrainer_mle.json +0 -68
- teradataml/analytics/mle/json/seriessplitter_mle.json +0 -133
- teradataml/analytics/mle/json/sessionize_mle_mle.json +0 -62
- teradataml/analytics/mle/json/simplemovavg_mle.json +0 -48
- teradataml/analytics/mle/json/stringsimilarity_mle.json +0 -50
- teradataml/analytics/mle/json/stringsimilarity_mle_mle.json +0 -50
- teradataml/analytics/mle/json/svmdense_mle.json +0 -165
- teradataml/analytics/mle/json/svmdensepredict_mle.json +0 -95
- teradataml/analytics/mle/json/svmdensesummary_mle.json +0 -58
- teradataml/analytics/mle/json/svmsparse_mle.json +0 -148
- teradataml/analytics/mle/json/svmsparsepredict_mle_mle.json +0 -103
- teradataml/analytics/mle/json/svmsparsesummary_mle.json +0 -57
- teradataml/analytics/mle/json/textchunker_mle.json +0 -40
- teradataml/analytics/mle/json/textclassifier_mle.json +0 -51
- teradataml/analytics/mle/json/textclassifierevaluator_mle.json +0 -43
- teradataml/analytics/mle/json/textclassifiertrainer_mle.json +0 -103
- teradataml/analytics/mle/json/textmorph_mle.json +0 -63
- teradataml/analytics/mle/json/textparser_mle.json +0 -166
- teradataml/analytics/mle/json/texttagger_mle.json +0 -81
- teradataml/analytics/mle/json/texttokenizer_mle.json +0 -91
- teradataml/analytics/mle/json/tf_mle.json +0 -33
- teradataml/analytics/mle/json/tfidf_mle.json +0 -34
- teradataml/analytics/mle/json/univariatestatistics_mle.json +0 -81
- teradataml/analytics/mle/json/unpack_mle.json +0 -91
- teradataml/analytics/mle/json/unpack_mle_mle.json +0 -91
- teradataml/analytics/mle/json/unpivoting_mle.json +0 -63
- teradataml/analytics/mle/json/varmax_mle.json +0 -176
- teradataml/analytics/mle/json/vectordistance_mle.json +0 -179
- teradataml/analytics/mle/json/weightedmovavg_mle.json +0 -48
- teradataml/analytics/mle/json/xgboost_mle.json +0 -178
- teradataml/analytics/mle/json/xgboostpredict_mle.json +0 -104
- teradataml/analytics/sqle/Antiselect.py +0 -321
- teradataml/analytics/sqle/Attribution.py +0 -603
- teradataml/analytics/sqle/DecisionForestPredict.py +0 -408
- teradataml/analytics/sqle/GLMPredict.py +0 -430
- teradataml/analytics/sqle/MovingAverage.py +0 -543
- teradataml/analytics/sqle/NGramSplitter.py +0 -548
- teradataml/analytics/sqle/NPath.py +0 -632
- teradataml/analytics/sqle/NaiveBayesTextClassifierPredict.py +0 -515
- teradataml/analytics/sqle/Pack.py +0 -388
- teradataml/analytics/sqle/SVMSparsePredict.py +0 -464
- teradataml/analytics/sqle/Sessionize.py +0 -390
- teradataml/analytics/sqle/StringSimilarity.py +0 -400
- teradataml/analytics/sqle/Unpack.py +0 -503
- teradataml/analytics/sqle/json/antiselect_sqle.json +0 -21
- teradataml/analytics/sqle/json/attribution_sqle.json +0 -92
- teradataml/analytics/sqle/json/decisionforestpredict_sqle.json +0 -48
- teradataml/analytics/sqle/json/glmpredict_sqle.json +0 -48
- teradataml/analytics/sqle/json/h2opredict_sqle.json +0 -63
- teradataml/analytics/sqle/json/movingaverage_sqle.json +0 -58
- teradataml/analytics/sqle/json/naivebayestextclassifierpredict_sqle.json +0 -76
- teradataml/analytics/sqle/json/ngramsplitter_sqle.json +0 -126
- teradataml/analytics/sqle/json/npath_sqle.json +0 -67
- teradataml/analytics/sqle/json/pack_sqle.json +0 -47
- teradataml/analytics/sqle/json/pmmlpredict_sqle.json +0 -55
- teradataml/analytics/sqle/json/sessionize_sqle.json +0 -43
- teradataml/analytics/sqle/json/stringsimilarity_sqle.json +0 -39
- teradataml/analytics/sqle/json/svmsparsepredict_sqle.json +0 -74
- teradataml/analytics/sqle/json/unpack_sqle.json +0 -80
- teradataml/catalog/model_cataloging.py +0 -980
- teradataml/config/mlengine_alias_definitions_v1.0 +0 -118
- teradataml/config/mlengine_alias_definitions_v1.1 +0 -127
- teradataml/config/mlengine_alias_definitions_v1.3 +0 -129
- teradataml/table_operators/sandbox_container_util.py +0 -643
- teradataml-17.20.0.7.dist-info/RECORD +0 -1280
- {teradataml-17.20.0.7.dist-info → teradataml-20.0.0.0.dist-info}/top_level.txt +0 -0
teradataml/utils/validators.py
CHANGED
|
@@ -1,2115 +1,2239 @@
|
|
|
1
|
-
import numbers
|
|
2
|
-
import os
|
|
3
|
-
import pandas as pd
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
import re
|
|
6
|
-
from teradataml.common.constants import TeradataConstants, PTITableConstants, PythonTypes
|
|
7
|
-
from teradataml.common.exceptions import TeradataMlException
|
|
8
|
-
from teradataml.common.messages import MessageCodes, Messages
|
|
9
|
-
from teradataml.utils.dtypes import _Dtypes, _DtypesMappers, _ListOf, _TupleOf
|
|
10
|
-
from teradataml.options.configure import configure
|
|
11
|
-
from teradataml.dataframe.sql_interfaces import ColumnExpression
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
@
|
|
378
|
-
def
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
"""
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
#
|
|
457
|
-
if (
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
arg
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
if
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
Types:
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
Optional Argument.
|
|
834
|
-
Specifies
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
if
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
Specifies
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
if
|
|
950
|
-
return True
|
|
951
|
-
|
|
952
|
-
#
|
|
953
|
-
if
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
if
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
#
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
Types:
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
Required Argument.
|
|
1096
|
-
Specifies the
|
|
1097
|
-
Types: str
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
Required Argument.
|
|
1101
|
-
Specifies the
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
Types:
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
Types:
|
|
1115
|
-
|
|
1116
|
-
RETURNS:
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
RAISES:
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
EXAMPLES:
|
|
1123
|
-
_Validators.
|
|
1124
|
-
"""
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
Types: str
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
#
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
if
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
"""
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
Required Argument.
|
|
1241
|
-
Specifies the name of
|
|
1242
|
-
Types: str
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
Required Argument.
|
|
1246
|
-
Specifies the value
|
|
1247
|
-
Types:
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
Required Argument.
|
|
1251
|
-
Specifies the
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
Types:
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
Types:
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
TeradataMlException
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
"""
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
"""
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
Types:
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
Specifies the
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
1
|
+
import numbers
|
|
2
|
+
import os
|
|
3
|
+
import pandas as pd
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import re
|
|
6
|
+
from teradataml.common.constants import TeradataConstants, PTITableConstants, PythonTypes
|
|
7
|
+
from teradataml.common.exceptions import TeradataMlException
|
|
8
|
+
from teradataml.common.messages import MessageCodes, Messages
|
|
9
|
+
from teradataml.utils.dtypes import _Dtypes, _DtypesMappers, _ListOf, _TupleOf
|
|
10
|
+
from teradataml.options.configure import configure
|
|
11
|
+
from teradataml.dataframe.sql_interfaces import ColumnExpression
|
|
12
|
+
from functools import wraps, reduce
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def skip_validation():
|
|
16
|
+
"""
|
|
17
|
+
DESCRIPTION:
|
|
18
|
+
Define for skipping the validation.
|
|
19
|
+
|
|
20
|
+
PARAMETERS:
|
|
21
|
+
None
|
|
22
|
+
|
|
23
|
+
EXAMPLES:
|
|
24
|
+
@skip_validation(skip_all=True)
|
|
25
|
+
def validation_func(): ...
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
def decorator(func):
|
|
29
|
+
def wrapper(*args, **kwargs):
|
|
30
|
+
# If "skip_all" flag is set to False,
|
|
31
|
+
# skip all validation execution.
|
|
32
|
+
if not _Validators.skip_all:
|
|
33
|
+
return func(*args, **kwargs)
|
|
34
|
+
return wraps(func)(wrapper)
|
|
35
|
+
return decorator
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class _Validators:
|
|
39
|
+
"""
|
|
40
|
+
A class containing set of utilities that can be used for validations of various kinds.
|
|
41
|
+
Currently, this facilitates the validations done for:
|
|
42
|
+
1. Analytic function execution engine: (_validate_engine)
|
|
43
|
+
2. Validation for the vantage_version: (_validate_vantage_version)
|
|
44
|
+
3. Validate whether argument has passed with empty string or not: (_validate_input_columns_not_empty)
|
|
45
|
+
4. Validate for permitted values of the argument: (_validate_permitted_values)
|
|
46
|
+
5. Validate function arguments. (_validate_function_arguments) This specifically validates for
|
|
47
|
+
1. Argument types check.
|
|
48
|
+
2. Argument is empty or not.
|
|
49
|
+
3. Permitted values check.
|
|
50
|
+
6. Validate for missing required arguments.
|
|
51
|
+
7. Validate column exists in a DataFrame or not. (_validate_column_exists_in_dataframe)
|
|
52
|
+
8. Validate required arguments are missing or not. (_validate_missing_required_arguments)
|
|
53
|
+
9. Validate whether function install location is set.
|
|
54
|
+
10. Validate whether the table exist in the schema or not
|
|
55
|
+
11. Validate whether the given file is not empty, given absolute file path.
|
|
56
|
+
12. Validate whether "arg1" and "arg2" are mutually inclusive.
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
# "skip_all" specifies to skip all the executions.
|
|
60
|
+
skip_all = False
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
@skip_validation()
|
|
64
|
+
def __getTypeAsStr(type_list):
|
|
65
|
+
"""
|
|
66
|
+
Function to convert type to string.
|
|
67
|
+
|
|
68
|
+
PARAMETERS:
|
|
69
|
+
type_list
|
|
70
|
+
Required Argument.
|
|
71
|
+
A tuple of types or a type to be converted to string.
|
|
72
|
+
|
|
73
|
+
RAISES:
|
|
74
|
+
None
|
|
75
|
+
|
|
76
|
+
RETURNS:
|
|
77
|
+
A list of strings representing types in type_list.
|
|
78
|
+
|
|
79
|
+
EXAMPLES:
|
|
80
|
+
_Validators.__getTypeAsStr(type_list)
|
|
81
|
+
"""
|
|
82
|
+
type_as_str = []
|
|
83
|
+
if isinstance(type_list, tuple):
|
|
84
|
+
for typ in type_list:
|
|
85
|
+
if isinstance(typ, tuple):
|
|
86
|
+
for typ1 in typ:
|
|
87
|
+
type_as_str.append(typ1.__name__)
|
|
88
|
+
elif isinstance(typ, (_ListOf, _TupleOf)):
|
|
89
|
+
type_as_str.append(str(typ))
|
|
90
|
+
elif typ.__name__ == "DataFrame":
|
|
91
|
+
type_as_str.append("teradataml DataFrame")
|
|
92
|
+
else:
|
|
93
|
+
type_as_str.append(typ.__name__)
|
|
94
|
+
|
|
95
|
+
if isinstance(type_list, type):
|
|
96
|
+
if type_list.__name__ == "DataFrame":
|
|
97
|
+
type_as_str.append("teradataml DataFrame")
|
|
98
|
+
else:
|
|
99
|
+
type_as_str.append(type_list.__name__)
|
|
100
|
+
|
|
101
|
+
if isinstance(type_list, (_ListOf, _TupleOf)):
|
|
102
|
+
type_as_str.append(str(type_list))
|
|
103
|
+
|
|
104
|
+
return type_as_str
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
@skip_validation()
|
|
108
|
+
def _check_isinstance(obj, class_or_tuple):
|
|
109
|
+
"""
|
|
110
|
+
Function checks whether an object is an instance of a class.
|
|
111
|
+
|
|
112
|
+
PARAMETER
|
|
113
|
+
obj:
|
|
114
|
+
Required Argument.
|
|
115
|
+
Specifies the object to check instance of.
|
|
116
|
+
|
|
117
|
+
class_or_tuple:
|
|
118
|
+
Required Argument.
|
|
119
|
+
Specifies the type or tuple of types to check instance against.
|
|
120
|
+
|
|
121
|
+
RAISES:
|
|
122
|
+
None.
|
|
123
|
+
|
|
124
|
+
RETURNS:
|
|
125
|
+
True, if obj is instance of class_or_tuple
|
|
126
|
+
|
|
127
|
+
EXAMPLES:
|
|
128
|
+
_Validators._check_isinstance(obj, (int, list, str))
|
|
129
|
+
"""
|
|
130
|
+
# If obj is of type bool and type to check against contains int, then we must
|
|
131
|
+
# check/validate the instance as type(obj) == class_or_tuple.
|
|
132
|
+
# bool is subclass of int, hence isinstance(True, int) will always return true.
|
|
133
|
+
# And we would like to return false, as bool is not a int.
|
|
134
|
+
if not isinstance(obj, bool):
|
|
135
|
+
# If obj of any type other than bool, then we shall use "isinstance()"
|
|
136
|
+
# to perform type checks.
|
|
137
|
+
return isinstance(obj, class_or_tuple)
|
|
138
|
+
|
|
139
|
+
else:
|
|
140
|
+
# 'obj' is of type bool.
|
|
141
|
+
if isinstance(class_or_tuple, tuple):
|
|
142
|
+
if int not in class_or_tuple:
|
|
143
|
+
# If class_or_tuple is instance of tuple and int is not in class_or_tuple
|
|
144
|
+
# use "isinstance()" to validate type check for obj.
|
|
145
|
+
return isinstance(obj, class_or_tuple)
|
|
146
|
+
else:
|
|
147
|
+
return type(obj) in class_or_tuple
|
|
148
|
+
|
|
149
|
+
else: # isinstance(class_or_tuple, type):
|
|
150
|
+
if int != class_or_tuple:
|
|
151
|
+
# If class_or_tuple is instance of type and class_or_tuple is not an int
|
|
152
|
+
# use "isinstance()" to validate type check for obj.
|
|
153
|
+
return isinstance(obj, class_or_tuple)
|
|
154
|
+
else:
|
|
155
|
+
return type(obj) == class_or_tuple
|
|
156
|
+
|
|
157
|
+
@staticmethod
|
|
158
|
+
@skip_validation()
|
|
159
|
+
def _validate_columnexpression_dataframe_has_columns(columns,
|
|
160
|
+
arg_name,
|
|
161
|
+
column_expression):
|
|
162
|
+
"""
|
|
163
|
+
DESCRIPTION:
|
|
164
|
+
Function to check whether column name(s) available in dataframe
|
|
165
|
+
or not from a given column. This function is used currently
|
|
166
|
+
only for Window Aggregates.
|
|
167
|
+
|
|
168
|
+
PARAMETERS:
|
|
169
|
+
columns:
|
|
170
|
+
Required Argument.
|
|
171
|
+
Specifies the name or list of names of columns to be validated
|
|
172
|
+
for existence.
|
|
173
|
+
Types: str or List of strings
|
|
174
|
+
|
|
175
|
+
arg_name:
|
|
176
|
+
Required Argument.
|
|
177
|
+
Specifies the name of the argument.
|
|
178
|
+
Types: str
|
|
179
|
+
|
|
180
|
+
column_expression:
|
|
181
|
+
Required Argument.
|
|
182
|
+
Specifies teradataml DataFrame Column to check against for
|
|
183
|
+
column existence.
|
|
184
|
+
Types: ColumnExpression
|
|
185
|
+
|
|
186
|
+
RAISES:
|
|
187
|
+
ValueError
|
|
188
|
+
|
|
189
|
+
RETURNS:
|
|
190
|
+
bool
|
|
191
|
+
|
|
192
|
+
EXAMPLES:
|
|
193
|
+
_Validators._validate_dataframe_has_argument_columns_from_column(self.data_sequence_column,
|
|
194
|
+
"data_sequence_column",
|
|
195
|
+
self.data.col)
|
|
196
|
+
"""
|
|
197
|
+
if not columns:
|
|
198
|
+
return True
|
|
199
|
+
from teradataml.common.utils import UtilFuncs
|
|
200
|
+
# Converting columns to a list if string is passed.
|
|
201
|
+
if not isinstance(columns, list):
|
|
202
|
+
columns = [columns]
|
|
203
|
+
|
|
204
|
+
df_columns = UtilFuncs._all_df_columns(column_expression)
|
|
205
|
+
|
|
206
|
+
# Let's validate existence of each column one by one.
|
|
207
|
+
for column_name in columns:
|
|
208
|
+
# If column name does not exist in DataFrame of a column, raise the exception.
|
|
209
|
+
if column_name not in df_columns:
|
|
210
|
+
message = "{}. Check the argument '{}'".format(sorted(df_columns), arg_name)
|
|
211
|
+
raise ValueError(Messages.get_message(MessageCodes.TDMLDF_DROP_INVALID_COL,
|
|
212
|
+
column_name,
|
|
213
|
+
message
|
|
214
|
+
))
|
|
215
|
+
return True
|
|
216
|
+
|
|
217
|
+
@staticmethod
|
|
218
|
+
@skip_validation()
|
|
219
|
+
def _validate_invalid_column_types(all_columns, column_arg, columns_to_check, invalid_types):
|
|
220
|
+
"""
|
|
221
|
+
DESCRIPTION:
|
|
222
|
+
Function to validate the invalid types for "columns_to_check" from "all_columns".
|
|
223
|
+
|
|
224
|
+
PARAMETERS:
|
|
225
|
+
all_columns:
|
|
226
|
+
Required Argument.
|
|
227
|
+
Specifies the ColumnExpressions.
|
|
228
|
+
Types: List of ColumnExpression
|
|
229
|
+
|
|
230
|
+
column_arg:
|
|
231
|
+
Required Argument.
|
|
232
|
+
Specifies the name of the argument.
|
|
233
|
+
Types: str
|
|
234
|
+
|
|
235
|
+
columns_to_check:
|
|
236
|
+
Required Argument.
|
|
237
|
+
Specifies columns to check for invalid types.
|
|
238
|
+
Types: str OR list of str OR ColumnExpression OR list of ColumnExpression
|
|
239
|
+
|
|
240
|
+
invalid_types:
|
|
241
|
+
Required Argument.
|
|
242
|
+
Specifies list of invalid teradata types to check against "columns".
|
|
243
|
+
Types: list
|
|
244
|
+
|
|
245
|
+
RAISES:
|
|
246
|
+
ValueError
|
|
247
|
+
|
|
248
|
+
RETURNS:
|
|
249
|
+
bool
|
|
250
|
+
|
|
251
|
+
EXAMPLES:
|
|
252
|
+
_Validators._validate_invalid_column_types(columns, column_arg, invalid_types)
|
|
253
|
+
"""
|
|
254
|
+
columns_and_types = {c.name.lower(): type(c.type) for c in all_columns}
|
|
255
|
+
get_col_type = lambda column: columns_and_types[column.lower()].__name__ if isinstance(
|
|
256
|
+
column, str) else column.type.__class__.__name__
|
|
257
|
+
|
|
258
|
+
invalid_types = ["{}({})".format(column if isinstance(column, str) else column.name, get_col_type(column))
|
|
259
|
+
for column in columns_to_check if get_col_type(column)
|
|
260
|
+
in [t.__name__ for t in _Dtypes._get_sort_unsupported_data_types()]
|
|
261
|
+
]
|
|
262
|
+
|
|
263
|
+
if invalid_types:
|
|
264
|
+
invalid_column_types = (col_type.__name__ for col_type in
|
|
265
|
+
_Dtypes._get_sort_unsupported_data_types())
|
|
266
|
+
error_message = Messages.get_message(MessageCodes.INVALID_COLUMN_DATATYPE,
|
|
267
|
+
", ".join(invalid_types),
|
|
268
|
+
column_arg,
|
|
269
|
+
"Unsupported",
|
|
270
|
+
", ".join(invalid_column_types))
|
|
271
|
+
|
|
272
|
+
raise ValueError(error_message)
|
|
273
|
+
|
|
274
|
+
return True
|
|
275
|
+
|
|
276
|
+
@staticmethod
|
|
277
|
+
@skip_validation()
|
|
278
|
+
def _validate_dataframe_has_argument_columns(columns, column_arg, data, data_arg, is_partition_arg=False):
|
|
279
|
+
"""
|
|
280
|
+
Function to check whether column names in columns are present in given dataframe or not.
|
|
281
|
+
This function is used currently only for Analytics wrappers.
|
|
282
|
+
|
|
283
|
+
PARAMETERS:
|
|
284
|
+
columns:
|
|
285
|
+
Required Argument.
|
|
286
|
+
Specifies name or list of names of columns to be validated for existence.
|
|
287
|
+
Types: str or List of strings
|
|
288
|
+
|
|
289
|
+
column_arg:
|
|
290
|
+
Required Argument.
|
|
291
|
+
Specifies the name of the argument.
|
|
292
|
+
Types: str
|
|
293
|
+
|
|
294
|
+
data:
|
|
295
|
+
Required Argument.
|
|
296
|
+
Specifies teradataml DataFrame to check against for column existence.
|
|
297
|
+
Types: teradataml DataFrame
|
|
298
|
+
|
|
299
|
+
data_arg:
|
|
300
|
+
Required Argument.
|
|
301
|
+
Specifies the name of the dataframe argument.
|
|
302
|
+
Types: str
|
|
303
|
+
|
|
304
|
+
isPartitionArg:
|
|
305
|
+
Optional Argument.
|
|
306
|
+
Specifies a bool argument notifying, whether argument being validate is
|
|
307
|
+
Partition argument or not.
|
|
308
|
+
Types: bool
|
|
309
|
+
|
|
310
|
+
RAISES:
|
|
311
|
+
TeradataMlException - TDMLDF_COLUMN_IN_ARG_NOT_FOUND column(s) does not exist in a dataframe.
|
|
312
|
+
|
|
313
|
+
EXAMPLES:
|
|
314
|
+
_Validators._validate_dataframe_has_argument_columns(self.data_sequence_column, "data_sequence_column", self.data, "data")
|
|
315
|
+
_Validators._validate_dataframe_has_argument_columns(self.data_partition_column, "data_sequence_column", self.data, "data", true)
|
|
316
|
+
"""
|
|
317
|
+
if is_partition_arg and columns is None:
|
|
318
|
+
return True
|
|
319
|
+
|
|
320
|
+
if columns is None:
|
|
321
|
+
return True
|
|
322
|
+
|
|
323
|
+
_Validators._validate_dependent_argument(column_arg, columns, data_arg, data)
|
|
324
|
+
|
|
325
|
+
# Converting columns to a list if string is passed.
|
|
326
|
+
if not isinstance(columns, list) and columns is not None:
|
|
327
|
+
columns = [columns]
|
|
328
|
+
|
|
329
|
+
total_columns = []
|
|
330
|
+
|
|
331
|
+
for column in columns:
|
|
332
|
+
for separator in TeradataConstants.RANGE_SEPARATORS.value:
|
|
333
|
+
if column is None:
|
|
334
|
+
total_columns.append(column)
|
|
335
|
+
elif column[0] == "-":
|
|
336
|
+
# If column has exclude operator "-".
|
|
337
|
+
# For example incase of "-[50]", let database handle validation.
|
|
338
|
+
if re.match(r'-\[\d+\]', column) is not None:
|
|
339
|
+
continue
|
|
340
|
+
total_columns.append(column[1:])
|
|
341
|
+
elif column.count(separator) == 1:
|
|
342
|
+
# Following cases can occur:
|
|
343
|
+
# '3:5' or 'colA:colE'
|
|
344
|
+
# ':4' or ':columnD' specifies all columns up to and including the column with index 4(or columnD).
|
|
345
|
+
# '4:' or 'columnD:' specifies the column with index 4(or columnD) and all columns after it.
|
|
346
|
+
# ':' specifies all columns in the table.
|
|
347
|
+
|
|
348
|
+
try:
|
|
349
|
+
# Check if its a sinlge column with one separator. For e.g. column:A.
|
|
350
|
+
# If yes, just continue.
|
|
351
|
+
_Validators._validate_column_exists_in_dataframe(column, data._metaexpr)
|
|
352
|
+
continue
|
|
353
|
+
except:
|
|
354
|
+
# User has provided range value.
|
|
355
|
+
column_names = column.split(separator)
|
|
356
|
+
if (len(column_names) == 2 and
|
|
357
|
+
any([column_names[0].isdigit(), column_names[1].isdigit()]) and
|
|
358
|
+
not all([column_names[0].isdigit(), column_names[1].isdigit()]) and
|
|
359
|
+
not "" in column_names):
|
|
360
|
+
# Raises Exception if column range has mixed types. For e.g. "4:XYZ".
|
|
361
|
+
err_msg = Messages.get_message(MessageCodes.MIXED_TYPES_IN_COLUMN_RANGE)
|
|
362
|
+
raise ValueError(err_msg.format(column_arg))
|
|
363
|
+
|
|
364
|
+
for col in column_names:
|
|
365
|
+
if not col.isdigit() and col != "":
|
|
366
|
+
total_columns.append(col)
|
|
367
|
+
|
|
368
|
+
elif column.count(separator) > 1:
|
|
369
|
+
continue
|
|
370
|
+
else:
|
|
371
|
+
total_columns.append(column)
|
|
372
|
+
|
|
373
|
+
return _Validators._validate_column_exists_in_dataframe(total_columns, data._metaexpr, column_arg=column_arg,
|
|
374
|
+
data_arg=data_arg)
|
|
375
|
+
|
|
376
|
+
@staticmethod
|
|
377
|
+
@skip_validation()
|
|
378
|
+
def _validate_column_exists_in_dataframe(columns, metaexpr, case_insensitive=False, column_arg=None,
|
|
379
|
+
data_arg=None, for_table=False):
|
|
380
|
+
"""
|
|
381
|
+
Method to check whether column or list of columns exists in a teradataml DataFrame or not.
|
|
382
|
+
|
|
383
|
+
PARAMETERS:
|
|
384
|
+
columns:
|
|
385
|
+
Required Argument.
|
|
386
|
+
Specifies name or list of names of columns to be validated for existence.
|
|
387
|
+
Types: str or List of strings
|
|
388
|
+
|
|
389
|
+
metaexpr:
|
|
390
|
+
Required Argument.
|
|
391
|
+
Specifies a teradataml DataFrame metaexpr to be validated against.
|
|
392
|
+
Types: MetaExpression
|
|
393
|
+
|
|
394
|
+
case_insensitive:
|
|
395
|
+
Optional Argument.
|
|
396
|
+
Specifies a flag, that determines whether to check for column existence in
|
|
397
|
+
case_insensitive manner or not.
|
|
398
|
+
Default Value: False (Case-Sensitive lookup)
|
|
399
|
+
Types: bool
|
|
400
|
+
|
|
401
|
+
column_arg:
|
|
402
|
+
Optional Argument.
|
|
403
|
+
Specifies the name of the argument.
|
|
404
|
+
Types: str
|
|
405
|
+
|
|
406
|
+
data_arg:
|
|
407
|
+
Optional Argument.
|
|
408
|
+
Specifies the name of the dataframe argument or name of the table.
|
|
409
|
+
Types: str
|
|
410
|
+
|
|
411
|
+
for_table:
|
|
412
|
+
Optional Argument.
|
|
413
|
+
Specifies whether error should be raised against table or DataFrame, i.e.,
|
|
414
|
+
when columns are not available and "for_table" is set to False, then
|
|
415
|
+
exception message mentions column(s) not available in DataFrame. When
|
|
416
|
+
columns are not available and "for_table" is set to true, then exception
|
|
417
|
+
message mentions column(s) not available in Table.
|
|
418
|
+
Types: str
|
|
419
|
+
|
|
420
|
+
RAISES:
|
|
421
|
+
ValueError
|
|
422
|
+
TDMLDF_DROP_INVALID_COL - If columns not found in metaexpr.
|
|
423
|
+
|
|
424
|
+
RETURNS:
|
|
425
|
+
None
|
|
426
|
+
|
|
427
|
+
EXAMPLES:
|
|
428
|
+
_Validators._validate_column_exists_in_dataframe(["col1", "col2"], self.metaexpr)
|
|
429
|
+
|
|
430
|
+
"""
|
|
431
|
+
if columns is None:
|
|
432
|
+
return True
|
|
433
|
+
|
|
434
|
+
# If just a column name is passed, convert it to a list.
|
|
435
|
+
if isinstance(columns, str):
|
|
436
|
+
columns = [columns]
|
|
437
|
+
|
|
438
|
+
# Constructing New unquotted column names for selected columns ONLY using Parent _metaexpr
|
|
439
|
+
if case_insensitive:
|
|
440
|
+
# If lookup has to be a case insensitive then convert the
|
|
441
|
+
# metaexpr columns name to lower case.
|
|
442
|
+
unquoted_df_columns = [c.name.replace('"', "").lower() for c in metaexpr.c]
|
|
443
|
+
else:
|
|
444
|
+
unquoted_df_columns = [c.name.replace('"', "") for c in metaexpr.c]
|
|
445
|
+
|
|
446
|
+
# Let's validate existence of each column one by one.
|
|
447
|
+
for column_name in columns:
|
|
448
|
+
if column_name is None:
|
|
449
|
+
column_name = str(column_name)
|
|
450
|
+
|
|
451
|
+
if case_insensitive:
|
|
452
|
+
# If lookup has to be a case insensitive then convert the
|
|
453
|
+
# column name to lower case.
|
|
454
|
+
column_name = column_name.lower()
|
|
455
|
+
|
|
456
|
+
# If column name does not exist in metaexpr, raise the exception
|
|
457
|
+
if not column_name.replace('"', "") in unquoted_df_columns:
|
|
458
|
+
if column_arg and data_arg:
|
|
459
|
+
raise ValueError(Messages.get_message(MessageCodes.TDMLDF_COLUMN_IN_ARG_NOT_FOUND,
|
|
460
|
+
column_name,
|
|
461
|
+
column_arg,
|
|
462
|
+
data_arg,
|
|
463
|
+
"Table" if for_table else "DataFrame"))
|
|
464
|
+
else:
|
|
465
|
+
raise ValueError(Messages.get_message(MessageCodes.TDMLDF_DROP_INVALID_COL,
|
|
466
|
+
column_name, sorted(unquoted_df_columns)))
|
|
467
|
+
|
|
468
|
+
return True
|
|
469
|
+
|
|
470
|
+
@staticmethod
|
|
471
|
+
@skip_validation()
|
|
472
|
+
def _validate_engine(engine):
|
|
473
|
+
"""
|
|
474
|
+
Function to validate whether the argument engine is supported or not.
|
|
475
|
+
|
|
476
|
+
PARAMETERS:
|
|
477
|
+
engine:
|
|
478
|
+
Required Argument.
|
|
479
|
+
Specifies the type of the engine.
|
|
480
|
+
|
|
481
|
+
RETURNS:
|
|
482
|
+
True, if engine is supported.
|
|
483
|
+
|
|
484
|
+
RAISES:
|
|
485
|
+
TeradataMLException
|
|
486
|
+
|
|
487
|
+
EXAMPLES:
|
|
488
|
+
_Validators._validate_engine("ENGINE_SQL")
|
|
489
|
+
"""
|
|
490
|
+
supported_engines = TeradataConstants.SUPPORTED_ENGINES.value
|
|
491
|
+
if engine not in supported_engines.keys():
|
|
492
|
+
raise TeradataMlException(Messages.get_message(
|
|
493
|
+
MessageCodes.CONFIG_ALIAS_ENGINE_NOT_SUPPORTED).format(engine,
|
|
494
|
+
", ".join(supported_engines.keys())),
|
|
495
|
+
MessageCodes.CONFIG_ALIAS_ENGINE_NOT_SUPPORTED)
|
|
496
|
+
|
|
497
|
+
return True
|
|
498
|
+
|
|
499
|
+
@staticmethod
|
|
500
|
+
@skip_validation()
|
|
501
|
+
def _validate_function_arguments(arg_list, skip_empty_check = None):
|
|
502
|
+
"""
|
|
503
|
+
Method to verify that the input arguments are of valid data type except for
|
|
504
|
+
argument of DataFrameType.
|
|
505
|
+
|
|
506
|
+
PARAMETERS:
|
|
507
|
+
arg_list:
|
|
508
|
+
Required Argument.
|
|
509
|
+
Specifies a list of arguments, expected types are mentioned as type or tuple.
|
|
510
|
+
argInfoMatrix = []
|
|
511
|
+
argInfoMatrix.append(["data", data, False, (DataFrame)])
|
|
512
|
+
argInfoMatrix.append(["centers", centers, True, (int, list)])
|
|
513
|
+
argInfoMatrix.append(["threshold", threshold, True, (float)])
|
|
514
|
+
Types: List of Lists
|
|
515
|
+
skip_empty_check:
|
|
516
|
+
Optional Argument.
|
|
517
|
+
Specifies column name and values for which to skip check.
|
|
518
|
+
Types: Dictionary specifying column name to values mapping.
|
|
519
|
+
|
|
520
|
+
RAISES:
|
|
521
|
+
Error if arguments are not of valid datatype
|
|
522
|
+
|
|
523
|
+
EXAMPLES:
|
|
524
|
+
_Validators._validate_function_arguments(arg_list)
|
|
525
|
+
"""
|
|
526
|
+
invalid_arg_names = []
|
|
527
|
+
invalid_arg_types = []
|
|
528
|
+
|
|
529
|
+
typeCheckFailed = False
|
|
530
|
+
|
|
531
|
+
for args in arg_list:
|
|
532
|
+
num_args = len(args)
|
|
533
|
+
if not isinstance(args[0], str):
|
|
534
|
+
raise TypeError("First element in argument information matrix should be str.")
|
|
535
|
+
|
|
536
|
+
if not isinstance(args[2], bool):
|
|
537
|
+
raise TypeError("Third element in argument information matrix should be bool.")
|
|
538
|
+
|
|
539
|
+
if not (isinstance(args[3], tuple) or isinstance(args[3], type) or
|
|
540
|
+
isinstance(args[3], (_ListOf, _TupleOf))):
|
|
541
|
+
err_msg = "Fourth element in argument information matrix should be a 'tuple of types' or 'type' type."
|
|
542
|
+
raise TypeError(err_msg)
|
|
543
|
+
|
|
544
|
+
if num_args >= 5:
|
|
545
|
+
if not isinstance(args[4], bool):
|
|
546
|
+
raise TypeError("Fifth element in argument information matrix should be bool.")
|
|
547
|
+
|
|
548
|
+
#
|
|
549
|
+
# Let's validate argument types.
|
|
550
|
+
#
|
|
551
|
+
# Verify datatypes for arguments which are required or the optional arguments are not None
|
|
552
|
+
if ((args[2] == True and args[1] is not None) or (args[2] == False)):
|
|
553
|
+
# Validate the types of argument, if expected types are instance of tuple or type
|
|
554
|
+
dtype_list = _Validators.__getTypeAsStr(args[3])
|
|
555
|
+
|
|
556
|
+
if isinstance(args[3], tuple) and list in args[3]:
|
|
557
|
+
# If list of data types contain 'list', which means argument can accept list of values.
|
|
558
|
+
dtype_list.remove('list')
|
|
559
|
+
valid_types_str = ", ".join(dtype_list) + " or list of values of type(s): " + ", ".join(
|
|
560
|
+
dtype_list)
|
|
561
|
+
|
|
562
|
+
if isinstance(args[1], list):
|
|
563
|
+
# If argument contains list of values, check each value.
|
|
564
|
+
for value in args[1]:
|
|
565
|
+
# If not valid datatype add invalid_arg to dictionary and break
|
|
566
|
+
if not _Validators._check_isinstance(value, args[3]):
|
|
567
|
+
invalid_arg_names.append(args[0])
|
|
568
|
+
invalid_arg_types.append(valid_types_str)
|
|
569
|
+
typeCheckFailed = True
|
|
570
|
+
break
|
|
571
|
+
elif not _Validators._check_isinstance(args[1], args[3]):
|
|
572
|
+
# Argument is not of type list.
|
|
573
|
+
invalid_arg_names.append(args[0])
|
|
574
|
+
invalid_arg_types.append(valid_types_str)
|
|
575
|
+
typeCheckFailed = True
|
|
576
|
+
|
|
577
|
+
elif isinstance(args[3], tuple):
|
|
578
|
+
# Argument can accept values of multiple types, but not list.
|
|
579
|
+
valid_types_str = " or ".join(dtype_list)
|
|
580
|
+
if not _Validators._check_isinstance(args[1], args[3]):
|
|
581
|
+
invalid_arg_names.append(args[0])
|
|
582
|
+
invalid_arg_types.append(valid_types_str)
|
|
583
|
+
typeCheckFailed = True
|
|
584
|
+
else:
|
|
585
|
+
# Argument can accept values of single type.
|
|
586
|
+
valid_types_str = " or ".join(dtype_list)
|
|
587
|
+
if not _Validators._check_isinstance(args[1], args[3]):
|
|
588
|
+
invalid_arg_names.append(args[0])
|
|
589
|
+
invalid_arg_types.append(valid_types_str)
|
|
590
|
+
typeCheckFailed = True
|
|
591
|
+
|
|
592
|
+
#
|
|
593
|
+
# Validate the arguments for empty value
|
|
594
|
+
#
|
|
595
|
+
if not typeCheckFailed and len(args) >= 5:
|
|
596
|
+
if args[4]:
|
|
597
|
+
_Validators._validate_input_columns_not_empty(args[1], args[0], skip_empty_check)
|
|
598
|
+
|
|
599
|
+
#
|
|
600
|
+
# Validate the arguments for permitted values
|
|
601
|
+
#
|
|
602
|
+
if not typeCheckFailed and len(args) >= 6:
|
|
603
|
+
if args[5] is not None:
|
|
604
|
+
_Validators._validate_permitted_values(args[1], args[5], args[0], supported_types=args[3])
|
|
605
|
+
|
|
606
|
+
if typeCheckFailed:
|
|
607
|
+
if len(invalid_arg_names) != 0:
|
|
608
|
+
raise TypeError(Messages.get_message(MessageCodes.UNSUPPORTED_DATATYPE,
|
|
609
|
+
invalid_arg_names, invalid_arg_types))
|
|
610
|
+
|
|
611
|
+
return True
|
|
612
|
+
|
|
613
|
+
@staticmethod
|
|
614
|
+
@skip_validation()
|
|
615
|
+
def _validate_input_columns_not_empty(arg, arg_name, skip_empty_check = None):
|
|
616
|
+
"""
|
|
617
|
+
Function to check whether argument is empty string or not.
|
|
618
|
+
|
|
619
|
+
PARAMETERS:
|
|
620
|
+
arg:
|
|
621
|
+
Required Argument.
|
|
622
|
+
Argument value (string) to be checked whether it is empty or not.
|
|
623
|
+
skip_empty_check:
|
|
624
|
+
Optional Argument.
|
|
625
|
+
Specifies column name and values for which to skip check.
|
|
626
|
+
Types: Dictionary specifying column name to values mapping.
|
|
627
|
+
Example: When '\n', '\t' are valid values for argument 'arg_name', this check should be skipped.
|
|
628
|
+
|
|
629
|
+
RAISES:
|
|
630
|
+
Error if argument contains empty string
|
|
631
|
+
|
|
632
|
+
EXAMPLES:
|
|
633
|
+
_Validators._validate_input_columns_not_empty(arg)
|
|
634
|
+
"""
|
|
635
|
+
if isinstance(arg, str):
|
|
636
|
+
if not (skip_empty_check and arg_name in skip_empty_check.keys() and arg in skip_empty_check[arg_name]):
|
|
637
|
+
if ((len(arg.strip()) == 0)):
|
|
638
|
+
raise ValueError(Messages.get_message(MessageCodes.ARG_EMPTY, arg_name))
|
|
639
|
+
|
|
640
|
+
if isinstance(arg, list):
|
|
641
|
+
if len(arg) == 0:
|
|
642
|
+
raise ValueError(Messages.get_message(MessageCodes.ARG_EMPTY, arg_name).replace("empty string", "an empty list"))
|
|
643
|
+
|
|
644
|
+
for col in arg:
|
|
645
|
+
if not (skip_empty_check and arg_name in skip_empty_check.keys() and col in skip_empty_check[arg_name]):
|
|
646
|
+
if isinstance(col, str):
|
|
647
|
+
if (not (col is None) and ((len(col.strip()) == 0))):
|
|
648
|
+
raise ValueError(Messages.get_message(MessageCodes.ARG_EMPTY, arg_name))
|
|
649
|
+
return True
|
|
650
|
+
|
|
651
|
+
@staticmethod
|
|
652
|
+
@skip_validation()
|
|
653
|
+
def _validate_missing_required_arguments(arg_list):
|
|
654
|
+
"""
|
|
655
|
+
Method to check whether the required arguments passed to the function are missing
|
|
656
|
+
or not. Only wrapper's use this function.
|
|
657
|
+
|
|
658
|
+
PARAMETERS:
|
|
659
|
+
arg_list - A list
|
|
660
|
+
The argument is expected to be a list of arguments
|
|
661
|
+
|
|
662
|
+
RAISES:
|
|
663
|
+
If any arguments are missing exception raised with missing arguments which are
|
|
664
|
+
required.
|
|
665
|
+
|
|
666
|
+
EXAMPLES:
|
|
667
|
+
An example input matrix will be:
|
|
668
|
+
arg_info_matrix = []
|
|
669
|
+
arg_info_matrix.append(["data", data, False, DataFrame])
|
|
670
|
+
arg_info_matrix.append(["centers", centers, True, int])
|
|
671
|
+
arg_info_matrix.append(["threshold", threshold, True, "float"])
|
|
672
|
+
awu = AnalyticsWrapperUtils()
|
|
673
|
+
awu._validate_missing_required_arguments(arg_info_matrix)
|
|
674
|
+
"""
|
|
675
|
+
miss_args = []
|
|
676
|
+
for args in arg_list:
|
|
677
|
+
'''
|
|
678
|
+
Check for missing arguments which are required. If args[2] is false
|
|
679
|
+
the argument is required.
|
|
680
|
+
The following conditions are true :
|
|
681
|
+
1. The argument should not be None and an empty string.
|
|
682
|
+
then argument is required which is missing and Raises exception.
|
|
683
|
+
'''
|
|
684
|
+
if args[2] == False and args[1] is None:
|
|
685
|
+
miss_args.append(args[0])
|
|
686
|
+
|
|
687
|
+
if (len(miss_args)>0):
|
|
688
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.MISSING_ARGS,miss_args),
|
|
689
|
+
MessageCodes.MISSING_ARGS)
|
|
690
|
+
return True
|
|
691
|
+
|
|
692
|
+
@staticmethod
|
|
693
|
+
@skip_validation()
|
|
694
|
+
def _validate_permitted_values(arg, permitted_values, arg_name, case_insensitive=True, includeNone=True, supported_types=None):
|
|
695
|
+
"""
|
|
696
|
+
Function to check the permitted values for the argument.
|
|
697
|
+
|
|
698
|
+
PARAMETERS:
|
|
699
|
+
arg:
|
|
700
|
+
Required Argument.
|
|
701
|
+
Argument value to be checked against permitted values from the list.
|
|
702
|
+
Types: string
|
|
703
|
+
|
|
704
|
+
permitted_values:
|
|
705
|
+
Required Argument.
|
|
706
|
+
A list of strings/ints/floats containing permitted values for the argument.
|
|
707
|
+
Types: string
|
|
708
|
+
|
|
709
|
+
arg_name:
|
|
710
|
+
Required Argument.
|
|
711
|
+
Name of the argument to be printed in the error message.
|
|
712
|
+
Types: string
|
|
713
|
+
|
|
714
|
+
case_insensitive:
|
|
715
|
+
Optional Argument.
|
|
716
|
+
Specifies whether values in permitted_values could be case sensitive.
|
|
717
|
+
Types: bool
|
|
718
|
+
|
|
719
|
+
includeNone:
|
|
720
|
+
Optional Argument.
|
|
721
|
+
Specifies whether 'None' can be included as valid value.
|
|
722
|
+
Types: bool
|
|
723
|
+
|
|
724
|
+
supported_types:
|
|
725
|
+
Optional Argument.
|
|
726
|
+
Specifies the supported datatypes for the argument.
|
|
727
|
+
Types: str
|
|
728
|
+
|
|
729
|
+
RAISES:
|
|
730
|
+
Error if argument is not present in the list
|
|
731
|
+
|
|
732
|
+
EXAMPLES:
|
|
733
|
+
permitted_values = ["LOGISTIC", "BINOMIAL", "POISSON", "GAUSSIAN", "GAMMA", "INVERSE_GAUSSIAN", "NEGATIVE_BINOMIAL"]
|
|
734
|
+
arg = "LOGISTIC"
|
|
735
|
+
_Validators._validate_permitted_values(arg, permitted_values, argument_name)
|
|
736
|
+
"""
|
|
737
|
+
# validating permitted_values type which has to be a list.
|
|
738
|
+
_Validators._validate_function_arguments([["permitted_values", permitted_values, False, (list)]])
|
|
739
|
+
|
|
740
|
+
if case_insensitive:
|
|
741
|
+
permitted_values = [item.upper() if isinstance(item, str) else item for item in permitted_values]
|
|
742
|
+
|
|
743
|
+
# Validate whether argument has value from permitted values list or not.
|
|
744
|
+
if not isinstance(arg, list) and arg is not None:
|
|
745
|
+
arg = [arg]
|
|
746
|
+
|
|
747
|
+
if arg is not None:
|
|
748
|
+
# Getting arguments in uppercase to compare with 'permitted_values'
|
|
749
|
+
arg_upper = []
|
|
750
|
+
for element in arg:
|
|
751
|
+
if element is None:
|
|
752
|
+
# If element is None, then we shall add a string "None"
|
|
753
|
+
if includeNone:
|
|
754
|
+
continue
|
|
755
|
+
arg_upper.append(str(element))
|
|
756
|
+
elif isinstance(element, str):
|
|
757
|
+
# If element is of type str, then we will convert it to upper case.
|
|
758
|
+
if case_insensitive:
|
|
759
|
+
arg_upper.append(element.upper())
|
|
760
|
+
else:
|
|
761
|
+
arg_upper.append(element)
|
|
762
|
+
else:
|
|
763
|
+
# For any other type of element, we will keep it as is.
|
|
764
|
+
arg_upper.append(element)
|
|
765
|
+
|
|
766
|
+
# Form the list of datatypes not present in the datatypes of permitted_values.
|
|
767
|
+
add_types = ()
|
|
768
|
+
if supported_types is not None:
|
|
769
|
+
# Convert type and tuple to list.
|
|
770
|
+
supported_types = [supported_types] if isinstance(supported_types, type) else supported_types
|
|
771
|
+
# Form a list for types which are not there in type of permitted_values.
|
|
772
|
+
add_types = tuple(set(list(supported_types)) - set(list(map(type, permitted_values))) - set([list]))
|
|
773
|
+
# Remove the arguments from arg_upper which are an instance of the add_types.
|
|
774
|
+
if len(add_types) > 0:
|
|
775
|
+
[arg_upper.remove(arg) for arg in arg_upper if isinstance(arg, add_types)]
|
|
776
|
+
|
|
777
|
+
# If any of the arguments in 'arg_upper' not in 'permitted_values',
|
|
778
|
+
# then, raise exception
|
|
779
|
+
upper_invalid_values = list(set(arg_upper).difference(set(permitted_values)))
|
|
780
|
+
|
|
781
|
+
if len(upper_invalid_values) > 0:
|
|
782
|
+
# Getting actual invalid arguments (non-upper)
|
|
783
|
+
invalid_values = []
|
|
784
|
+
for element in arg:
|
|
785
|
+
if element is None:
|
|
786
|
+
if includeNone:
|
|
787
|
+
continue
|
|
788
|
+
invalid_values.append(str(element))
|
|
789
|
+
elif isinstance(element, str) and element.upper() in upper_invalid_values:
|
|
790
|
+
invalid_values.append(element)
|
|
791
|
+
elif element in upper_invalid_values:
|
|
792
|
+
invalid_values.append(element)
|
|
793
|
+
invalid_values.sort()
|
|
794
|
+
|
|
795
|
+
# Concatenate the message for datatypes not present in datatypes of permitted_values.
|
|
796
|
+
if len(add_types) > 0 :
|
|
797
|
+
add_types = _Validators.__getTypeAsStr(add_types)
|
|
798
|
+
add_types = " or ".join(add_types)
|
|
799
|
+
permitted_values = "{} {}".format(permitted_values, "or any values of type {}".format(add_types))
|
|
800
|
+
|
|
801
|
+
raise ValueError(
|
|
802
|
+
Messages.get_message(MessageCodes.INVALID_ARG_VALUE,
|
|
803
|
+
', '.join([str(item) if not isinstance(item, str) else item for item in invalid_values]),
|
|
804
|
+
arg_name, permitted_values))
|
|
805
|
+
# If any of the arguments doesn't want to include None as valid value
|
|
806
|
+
# then, raise exception.
|
|
807
|
+
else:
|
|
808
|
+
if not includeNone:
|
|
809
|
+
raise ValueError(
|
|
810
|
+
Messages.get_message(MessageCodes.INVALID_ARG_VALUE, None,
|
|
811
|
+
arg_name, permitted_values), MessageCodes.INVALID_ARG_VALUE)
|
|
812
|
+
# Returns True when arg is None or there is no Exception
|
|
813
|
+
return True
|
|
814
|
+
|
|
815
|
+
@staticmethod
|
|
816
|
+
@skip_validation()
|
|
817
|
+
def _validate_positive_int(arg, arg_name, lbound=0, ubound=None, lbound_inclusive=False):
|
|
818
|
+
"""
|
|
819
|
+
Validation to check arg values is a positive int.
|
|
820
|
+
|
|
821
|
+
PARAMETERS:
|
|
822
|
+
arg:
|
|
823
|
+
Required Argument.
|
|
824
|
+
Specifies the number to be validated for positive INT.
|
|
825
|
+
Types: int
|
|
826
|
+
|
|
827
|
+
arg_name:
|
|
828
|
+
Required Argument.
|
|
829
|
+
Specifies the name of the argument to be printed in error message.
|
|
830
|
+
Types: str
|
|
831
|
+
|
|
832
|
+
lbound:
|
|
833
|
+
Optional Argument.
|
|
834
|
+
Specifies the lower bound value for arg.
|
|
835
|
+
Note: Value provided to this argument is exclusive, i.e., if value provided
|
|
836
|
+
to this argument 10, then error will be raised for any value of arg <= 10.
|
|
837
|
+
It can be made inclusive, if lbound_inclusive is set to 'True'.
|
|
838
|
+
Types: int
|
|
839
|
+
|
|
840
|
+
ubound:
|
|
841
|
+
Optional Argument.
|
|
842
|
+
Specifies the upper bound value for arg.
|
|
843
|
+
Note: Value provided to this argument is inclusive, i.e., if value provided
|
|
844
|
+
to this argument 10, then error will be raised for any value of arg > 10.
|
|
845
|
+
Types: int
|
|
846
|
+
|
|
847
|
+
lbound_inclusive:
|
|
848
|
+
Optional Argument.
|
|
849
|
+
Specifies a boolean flag telling API whether to lbound value is inclusive or not.
|
|
850
|
+
Types: bool
|
|
851
|
+
|
|
852
|
+
RAISES:
|
|
853
|
+
ValueError - If arg is not a positive int.
|
|
854
|
+
|
|
855
|
+
RETURNS:
|
|
856
|
+
True - If success
|
|
857
|
+
|
|
858
|
+
EXAMPLES:
|
|
859
|
+
# Validate n for value > 0
|
|
860
|
+
_Validators._validate_positive_int(n, "n")
|
|
861
|
+
# Validate n for value > 0 and value <= 32767
|
|
862
|
+
_Validators._validate_positive_int(n, "n", ubound="32767")
|
|
863
|
+
"""
|
|
864
|
+
if arg is None:
|
|
865
|
+
return True
|
|
866
|
+
|
|
867
|
+
if ubound is None:
|
|
868
|
+
if lbound_inclusive:
|
|
869
|
+
if not isinstance(arg, numbers.Integral) or arg < lbound:
|
|
870
|
+
raise ValueError(Messages.get_message(MessageCodes.TDMLDF_POSITIVE_INT).format(arg_name, "greater than or equal to"))
|
|
871
|
+
else:
|
|
872
|
+
if not isinstance(arg, numbers.Integral) or arg <= lbound:
|
|
873
|
+
raise ValueError(Messages.get_message(MessageCodes.TDMLDF_POSITIVE_INT).format(arg_name, "greater than"))
|
|
874
|
+
else:
|
|
875
|
+
if not isinstance(arg, numbers.Integral) or arg <= lbound or arg > ubound:
|
|
876
|
+
raise ValueError(Messages.get_message(MessageCodes.TDMLDF_LBOUND_UBOUND).format(
|
|
877
|
+
arg_name, "greater than {}".format(lbound),
|
|
878
|
+
" and less than or equal to {}".format(ubound)))
|
|
879
|
+
|
|
880
|
+
return True
|
|
881
|
+
|
|
882
|
+
@staticmethod
|
|
883
|
+
@skip_validation()
|
|
884
|
+
def _validate_argument_range(arg,
|
|
885
|
+
arg_name,
|
|
886
|
+
lbound=None,
|
|
887
|
+
ubound=None,
|
|
888
|
+
lbound_inclusive=False,
|
|
889
|
+
ubound_inclusive=False):
|
|
890
|
+
"""
|
|
891
|
+
DESCRIPTION:
|
|
892
|
+
Validation to check arg is in specified range.
|
|
893
|
+
|
|
894
|
+
PARAMETERS:
|
|
895
|
+
arg:
|
|
896
|
+
Required Argument.
|
|
897
|
+
Specifies the number to be validated for range check.
|
|
898
|
+
Types: int
|
|
899
|
+
|
|
900
|
+
arg_name:
|
|
901
|
+
Required Argument.
|
|
902
|
+
Specifies the name of the argument to be printed in error message.
|
|
903
|
+
Types: str
|
|
904
|
+
|
|
905
|
+
lbound:
|
|
906
|
+
Optional Argument.
|
|
907
|
+
Specifies the lower bound value for arg.
|
|
908
|
+
Note:
|
|
909
|
+
Value provided to this argument is exclusive, i.e., if
|
|
910
|
+
value provided to this argument 10, then error will be
|
|
911
|
+
raised for any value of arg < 10. It can be made inclusive,
|
|
912
|
+
if lbound_inclusive is set to 'True'.
|
|
913
|
+
Types: int OR float
|
|
914
|
+
|
|
915
|
+
ubound:
|
|
916
|
+
Optional Argument.
|
|
917
|
+
Specifies the upper bound value for arg.
|
|
918
|
+
Note:
|
|
919
|
+
Value provided to this argument is exclusive, i.e., if
|
|
920
|
+
value provided to this argument 10, then error will be
|
|
921
|
+
raised for any value of arg > 10. It can be made inclusive,
|
|
922
|
+
if ubound_inclusive is set to 'True'.
|
|
923
|
+
Types: int OR float
|
|
924
|
+
|
|
925
|
+
lbound_inclusive:
|
|
926
|
+
Optional Argument.
|
|
927
|
+
Specifies whether lbound value is inclusive or not. When set to True,
|
|
928
|
+
value is inclusive, otherwise exclusive.
|
|
929
|
+
Default Value: False
|
|
930
|
+
Types: bool
|
|
931
|
+
|
|
932
|
+
ubound_inclusive:
|
|
933
|
+
Optional Argument.
|
|
934
|
+
Specifies whether ubound value is inclusive or not. When set to True,
|
|
935
|
+
value is inclusive, otherwise exclusive.
|
|
936
|
+
Default Value: False
|
|
937
|
+
Types: bool
|
|
938
|
+
|
|
939
|
+
RAISES:
|
|
940
|
+
ValueError - If arg is not in the specified range.
|
|
941
|
+
|
|
942
|
+
RETURNS:
|
|
943
|
+
True - If success
|
|
944
|
+
|
|
945
|
+
EXAMPLES:
|
|
946
|
+
# Validate n for value in between of 10 and 20.
|
|
947
|
+
_Validators._validate_argument_range(n, 10, 20)
|
|
948
|
+
"""
|
|
949
|
+
if lbound is None and ubound is None:
|
|
950
|
+
return True
|
|
951
|
+
|
|
952
|
+
# Raise error if lower bound is greater than upper bound.
|
|
953
|
+
if lbound is not None and ubound is not None and (lbound > ubound):
|
|
954
|
+
raise ValueError("Lowerbound value '{}' must be less than upperbound value '{}'.".format(lbound, ubound))
|
|
955
|
+
|
|
956
|
+
# If argument is None, do not validate the argument.
|
|
957
|
+
if arg is None:
|
|
958
|
+
return True
|
|
959
|
+
|
|
960
|
+
is_arg_in_lower_bound, is_arg_in_upper_bound = True, True
|
|
961
|
+
lbound_msg, ubound_msg = "", ""
|
|
962
|
+
|
|
963
|
+
# Check for lower bound.
|
|
964
|
+
if lbound is not None:
|
|
965
|
+
if lbound_inclusive:
|
|
966
|
+
is_arg_in_lower_bound = arg >= lbound
|
|
967
|
+
lbound_msg = "greater than or equal to {}".format(lbound)
|
|
968
|
+
else:
|
|
969
|
+
is_arg_in_lower_bound = arg > lbound
|
|
970
|
+
lbound_msg = "greater than {}".format(lbound)
|
|
971
|
+
|
|
972
|
+
# Check for upper bound.
|
|
973
|
+
if ubound is not None:
|
|
974
|
+
if ubound_inclusive:
|
|
975
|
+
is_arg_in_upper_bound = arg <= ubound
|
|
976
|
+
ubound_msg = "less than or equal to {}".format(ubound)
|
|
977
|
+
else:
|
|
978
|
+
is_arg_in_upper_bound = arg < ubound
|
|
979
|
+
ubound_msg = "less than {}".format(ubound)
|
|
980
|
+
|
|
981
|
+
if not (is_arg_in_lower_bound and is_arg_in_upper_bound):
|
|
982
|
+
# If both lower bound and upper bound error messages available, append 'and' to
|
|
983
|
+
# upper bound message.
|
|
984
|
+
if lbound_msg and ubound_msg:
|
|
985
|
+
ubound_msg = " and {}".format(ubound_msg)
|
|
986
|
+
raise ValueError(
|
|
987
|
+
Messages.get_message(MessageCodes.TDMLDF_LBOUND_UBOUND).format(arg_name, lbound_msg, ubound_msg))
|
|
988
|
+
|
|
989
|
+
return True
|
|
990
|
+
|
|
991
|
+
@staticmethod
|
|
992
|
+
@skip_validation()
|
|
993
|
+
def _validate_vantage_version(vantage_version):
|
|
994
|
+
"""
|
|
995
|
+
Function to verify whether the given vantage_version is
|
|
996
|
+
supported or not.
|
|
997
|
+
|
|
998
|
+
PARAMETERS:
|
|
999
|
+
vantage_version:
|
|
1000
|
+
Required Argument.
|
|
1001
|
+
Specifies the vantage version.
|
|
1002
|
+
|
|
1003
|
+
RETURNS:
|
|
1004
|
+
True, if the current vantage version is supported or not.
|
|
1005
|
+
|
|
1006
|
+
RAISES:
|
|
1007
|
+
TeradataMLException
|
|
1008
|
+
|
|
1009
|
+
EXAMPLES:
|
|
1010
|
+
_Validators._validate_vantage_version("vantage1.0")
|
|
1011
|
+
"""
|
|
1012
|
+
supported_vantage_versions = TeradataConstants.SUPPORTED_VANTAGE_VERSIONS.value
|
|
1013
|
+
|
|
1014
|
+
# Raise exception if the vantage version is not supported.
|
|
1015
|
+
if vantage_version not in supported_vantage_versions.keys():
|
|
1016
|
+
err_ = Messages.get_message(MessageCodes.CONFIG_ALIAS_VANTAGE_VERSION_NOT_SUPPORTED). \
|
|
1017
|
+
format(vantage_version, ", ".join(supported_vantage_versions.keys()))
|
|
1018
|
+
raise TeradataMlException(err_,
|
|
1019
|
+
MessageCodes.CONFIG_ALIAS_VANTAGE_VERSION_NOT_SUPPORTED)
|
|
1020
|
+
|
|
1021
|
+
return True
|
|
1022
|
+
|
|
1023
|
+
@staticmethod
|
|
1024
|
+
@skip_validation()
|
|
1025
|
+
def _validate_timebucket_duration(timebucket_duration, timebucket_duration_arg_name='timebucket_duration'):
|
|
1026
|
+
"""
|
|
1027
|
+
Internal function to validate timeduration_bucket specified when creating a
|
|
1028
|
+
Primary Time Index (PTI) table.
|
|
1029
|
+
|
|
1030
|
+
PARAMETERS:
|
|
1031
|
+
timebucket_duration:
|
|
1032
|
+
Specifies the timebucket_duration passed to a function().
|
|
1033
|
+
Types: str
|
|
1034
|
+
|
|
1035
|
+
timebucket_duration_arg_name:
|
|
1036
|
+
Specifies the name of the argument to be displayed in the error message.
|
|
1037
|
+
Types: str
|
|
1038
|
+
|
|
1039
|
+
RETURNS:
|
|
1040
|
+
True if the value is valid.
|
|
1041
|
+
|
|
1042
|
+
RAISES:
|
|
1043
|
+
ValueError or TeradataMlException when the value is invalid.
|
|
1044
|
+
|
|
1045
|
+
EXAMPLES:
|
|
1046
|
+
_Validators._validate_timebucket_duration('HOURS(2)')
|
|
1047
|
+
_Validators._validate_timebucket_duration('2hours')
|
|
1048
|
+
_Validators._validate_timebucket_duration('ayear') # Invalid
|
|
1049
|
+
"""
|
|
1050
|
+
# Return True is it is not specified or is None since it is optional
|
|
1051
|
+
if timebucket_duration is None:
|
|
1052
|
+
return True
|
|
1053
|
+
|
|
1054
|
+
# Check if notation if formal or shorthand (beginning with a digit)
|
|
1055
|
+
if timebucket_duration[0].isdigit():
|
|
1056
|
+
valid_timebucket_durations = PTITableConstants.VALID_TIMEBUCKET_DURATIONS_SHORTHAND.value
|
|
1057
|
+
pattern_to_use = PTITableConstants.PATTERN_TIMEBUCKET_DURATION_SHORT.value
|
|
1058
|
+
normalized_timebucket_duration = timebucket_duration.lower()
|
|
1059
|
+
else:
|
|
1060
|
+
valid_timebucket_durations = PTITableConstants.VALID_TIMEBUCKET_DURATIONS_FORMAL.value
|
|
1061
|
+
pattern_to_use = PTITableConstants.PATTERN_TIMEBUCKET_DURATION_FORMAL.value
|
|
1062
|
+
normalized_timebucket_duration = timebucket_duration.upper()
|
|
1063
|
+
|
|
1064
|
+
for timebucket_duration_notation in valid_timebucket_durations:
|
|
1065
|
+
pattern = re.compile(pattern_to_use.format(timebucket_duration_notation))
|
|
1066
|
+
match = pattern.match(normalized_timebucket_duration)
|
|
1067
|
+
if match is not None:
|
|
1068
|
+
n = int(match.group(1))
|
|
1069
|
+
_Validators._validate_positive_int(n, "n", ubound=32767)
|
|
1070
|
+
|
|
1071
|
+
# Looks like the value is valid
|
|
1072
|
+
return True
|
|
1073
|
+
|
|
1074
|
+
# Match not found
|
|
1075
|
+
raise ValueError(Messages.get_message(
|
|
1076
|
+
MessageCodes.INVALID_ARG_VALUE).format(timebucket_duration, timebucket_duration_arg_name,
|
|
1077
|
+
'a valid time unit of format time_unit(n) or it\'s short hand '
|
|
1078
|
+
'equivalent notation'))
|
|
1079
|
+
|
|
1080
|
+
@staticmethod
|
|
1081
|
+
@skip_validation()
|
|
1082
|
+
def _validate_column_type(df, col, col_arg, expected_types, raiseError = True):
|
|
1083
|
+
"""
|
|
1084
|
+
Internal function to validate the type of an input DataFrame column against
|
|
1085
|
+
a list of expected types.
|
|
1086
|
+
|
|
1087
|
+
PARAMETERS
|
|
1088
|
+
df:
|
|
1089
|
+
Required Argument.
|
|
1090
|
+
Specifies the input teradataml DataFrame which has the column to be tested
|
|
1091
|
+
for type.
|
|
1092
|
+
Types: teradataml DataFrame
|
|
1093
|
+
|
|
1094
|
+
col:
|
|
1095
|
+
Required Argument.
|
|
1096
|
+
Specifies the column in the input DataFrame to be tested for type.
|
|
1097
|
+
Types: str
|
|
1098
|
+
|
|
1099
|
+
col_arg:
|
|
1100
|
+
Required Argument.
|
|
1101
|
+
Specifies the name of the argument used to pass the column name.
|
|
1102
|
+
Types: str
|
|
1103
|
+
|
|
1104
|
+
expected_types:
|
|
1105
|
+
Required Argument.
|
|
1106
|
+
Specifies a list of teradatasqlachemy datatypes that the column is
|
|
1107
|
+
expected to be of type.
|
|
1108
|
+
Types: list of teradatasqlalchemy types
|
|
1109
|
+
|
|
1110
|
+
raiseError:
|
|
1111
|
+
Optional Argument.
|
|
1112
|
+
Specifies a boolean flag that decides whether to raise error or just return True or False.
|
|
1113
|
+
Default Values: True, raise exception if column is not of desired type.
|
|
1114
|
+
Types: bool
|
|
1115
|
+
|
|
1116
|
+
RETURNS:
|
|
1117
|
+
True, when the columns is of an expected type.
|
|
1118
|
+
|
|
1119
|
+
RAISES:
|
|
1120
|
+
TeradataMlException, when the columns is not one of the expected types.
|
|
1121
|
+
|
|
1122
|
+
EXAMPLES:
|
|
1123
|
+
_Validators._validate_column_type(df, timecode_column, 'timecode_column', PTITableConstants.VALID_TIMECODE_DATATYPES)
|
|
1124
|
+
"""
|
|
1125
|
+
if not any(isinstance(df[col].type, t) for t in expected_types):
|
|
1126
|
+
if raiseError:
|
|
1127
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.INVALID_COLUMN_TYPE).
|
|
1128
|
+
format(col_arg, df[col].type, ' or '.join(expected_type.__visit_name__
|
|
1129
|
+
for expected_type in expected_types)),
|
|
1130
|
+
MessageCodes.INVALID_COLUMN_TYPE)
|
|
1131
|
+
else:
|
|
1132
|
+
return False
|
|
1133
|
+
|
|
1134
|
+
return True
|
|
1135
|
+
|
|
1136
|
+
@staticmethod
|
|
1137
|
+
@skip_validation()
|
|
1138
|
+
def _validate_aggr_operation_unsupported_datatype(operation, columns, td_column_names_and_types):
|
|
1139
|
+
"""
|
|
1140
|
+
Internal function to validate the for unsupported data types of an input DataFrame column for
|
|
1141
|
+
an aggreagate function.
|
|
1142
|
+
|
|
1143
|
+
PARAMETERS
|
|
1144
|
+
operation:
|
|
1145
|
+
Required Argument.
|
|
1146
|
+
Specifies the name of the aggregate operation.
|
|
1147
|
+
Types: str
|
|
1148
|
+
|
|
1149
|
+
columns:
|
|
1150
|
+
Required Argument.
|
|
1151
|
+
Specifies the column names to be validated for datatype check.
|
|
1152
|
+
Types: str
|
|
1153
|
+
|
|
1154
|
+
td_column_names_and_types:
|
|
1155
|
+
Required Argument.
|
|
1156
|
+
Specifies the input teradataml DataFrames column name to SQLAlchemy type mapper.
|
|
1157
|
+
Types: str
|
|
1158
|
+
|
|
1159
|
+
RETURNS:
|
|
1160
|
+
None
|
|
1161
|
+
|
|
1162
|
+
RAISES:
|
|
1163
|
+
TeradataMlException, when the columns is not one of the expected types.
|
|
1164
|
+
|
|
1165
|
+
EXAMPLES:
|
|
1166
|
+
_Validators._validate_aggr_operation_unsupported_datatype(operation, columns, td_column_names_and_types):
|
|
1167
|
+
"""
|
|
1168
|
+
# Check if the user provided columns has unsupported datatype for aggregate operation or not.
|
|
1169
|
+
# Get the list of unsupported types for aggregate function.
|
|
1170
|
+
unsupported_types = _Dtypes._get_unsupported_data_types_for_aggregate_operations(operation)
|
|
1171
|
+
invalid_columns = []
|
|
1172
|
+
|
|
1173
|
+
for column in columns:
|
|
1174
|
+
if isinstance(td_column_names_and_types[column.lower()], tuple(unsupported_types)):
|
|
1175
|
+
invalid_columns.append(
|
|
1176
|
+
"({0} - {1})".format(column, td_column_names_and_types[column.lower()]))
|
|
1177
|
+
|
|
1178
|
+
if len(invalid_columns) > 0:
|
|
1179
|
+
invalid_columns.sort() # helps in catching the columns in
|
|
1180
|
+
# lexicographic order
|
|
1181
|
+
error = MessageCodes.TDMLDF_AGGREGATE_UNSUPPORTED.value.format(
|
|
1182
|
+
", ".join(invalid_columns), operation)
|
|
1183
|
+
msg = Messages.get_message(MessageCodes.TDMLDF_AGGREGATE_COMBINED_ERR). \
|
|
1184
|
+
format(error)
|
|
1185
|
+
raise TeradataMlException(msg, MessageCodes.TDMLDF_AGGREGATE_COMBINED_ERR)
|
|
1186
|
+
|
|
1187
|
+
@staticmethod
|
|
1188
|
+
@skip_validation()
|
|
1189
|
+
def _validate_str_arg_length(arg_name, arg_value, op, length):
|
|
1190
|
+
"""
|
|
1191
|
+
Internal function to validate the length of a string passed as an argument.
|
|
1192
|
+
|
|
1193
|
+
PARAMETERS
|
|
1194
|
+
arg_name:
|
|
1195
|
+
Required Argument.
|
|
1196
|
+
Specifies the name of the argument for which we need to validate the value length.
|
|
1197
|
+
Types: str
|
|
1198
|
+
|
|
1199
|
+
arg_value:
|
|
1200
|
+
Required Argument.
|
|
1201
|
+
Specifies the value passed to the argument.
|
|
1202
|
+
Types: str
|
|
1203
|
+
|
|
1204
|
+
op:
|
|
1205
|
+
Required Argument.
|
|
1206
|
+
Specifies the type of check, and can be one of:
|
|
1207
|
+
* LT - Less than
|
|
1208
|
+
* LE - less than or equal to
|
|
1209
|
+
* GT - greater than
|
|
1210
|
+
* GE - greater than or equal to
|
|
1211
|
+
* EQ - equal to
|
|
1212
|
+
* NE - not equal to
|
|
1213
|
+
Types: str
|
|
1214
|
+
Permitted Values: ['LT', 'LE', 'GT', 'GE', 'EQ', 'NE']
|
|
1215
|
+
|
|
1216
|
+
length:
|
|
1217
|
+
Required Argument.
|
|
1218
|
+
Specifies the length against which the 'op' check for the argument value length will be made.
|
|
1219
|
+
Types: int
|
|
1220
|
+
|
|
1221
|
+
RETURNS:
|
|
1222
|
+
None
|
|
1223
|
+
|
|
1224
|
+
RAISES:
|
|
1225
|
+
ValueError.
|
|
1226
|
+
|
|
1227
|
+
EXAMPLES:
|
|
1228
|
+
_Validators._validate_str_arg_length("name", "The value", 10):
|
|
1229
|
+
"""
|
|
1230
|
+
return _Validators._validate_arg_length(arg_name=arg_name, arg_value=arg_value, op=op, length=length)
|
|
1231
|
+
|
|
1232
|
+
@staticmethod
|
|
1233
|
+
@skip_validation()
|
|
1234
|
+
def _validate_arg_length(arg_name, arg_value, op, length):
|
|
1235
|
+
"""
|
|
1236
|
+
Internal function to validate the length of an argument.
|
|
1237
|
+
|
|
1238
|
+
PARAMETERS
|
|
1239
|
+
arg_name:
|
|
1240
|
+
Required Argument.
|
|
1241
|
+
Specifies the name of the argument for which we need to validate the value length.
|
|
1242
|
+
Types: str
|
|
1243
|
+
|
|
1244
|
+
arg_value:
|
|
1245
|
+
Required Argument.
|
|
1246
|
+
Specifies the value passed to the argument.
|
|
1247
|
+
Types: str or list or tuple or set or dict
|
|
1248
|
+
|
|
1249
|
+
op:
|
|
1250
|
+
Required Argument.
|
|
1251
|
+
Specifies the type of check, and can be one of:
|
|
1252
|
+
* LT - Less than
|
|
1253
|
+
* LE - less than or equal to
|
|
1254
|
+
* GT - greater than
|
|
1255
|
+
* GE - greater than or equal to
|
|
1256
|
+
* EQ - equal to
|
|
1257
|
+
* NE - not equal to
|
|
1258
|
+
Types: str
|
|
1259
|
+
Permitted Values: ['LT', 'LE', 'GT', 'GE', 'EQ', 'NE']
|
|
1260
|
+
|
|
1261
|
+
length:
|
|
1262
|
+
Required Argument.
|
|
1263
|
+
Specifies the length against which the 'op' check for the argument value length will be made.
|
|
1264
|
+
Types: int
|
|
1265
|
+
|
|
1266
|
+
RETURNS:
|
|
1267
|
+
None
|
|
1268
|
+
|
|
1269
|
+
RAISES:
|
|
1270
|
+
ValueError.
|
|
1271
|
+
|
|
1272
|
+
EXAMPLES:
|
|
1273
|
+
_Validators._validate_arg_length("name", [1, 2, 3], 3):
|
|
1274
|
+
"""
|
|
1275
|
+
# Check if the length of the string value for the argument is acceptable.
|
|
1276
|
+
# First, check if op is an acceptable operation.
|
|
1277
|
+
acceptable_op = {'LT': int.__lt__,
|
|
1278
|
+
'LE': int.__le__,
|
|
1279
|
+
'GT': int.__gt__,
|
|
1280
|
+
'GE': int.__ge__,
|
|
1281
|
+
'EQ': int.__eq__,
|
|
1282
|
+
'NE': int.__ne__
|
|
1283
|
+
}
|
|
1284
|
+
if op not in acceptable_op:
|
|
1285
|
+
raise ValueError(Messages.get_message(MessageCodes.INVALID_ARG_VALUE,
|
|
1286
|
+
op, "op", acceptable_op))
|
|
1287
|
+
|
|
1288
|
+
# Format the error message with the substring based on the op type.
|
|
1289
|
+
errors = {'LT': "less than {}",
|
|
1290
|
+
'LE': "less than or equal to {}",
|
|
1291
|
+
'GT': "greater than {}",
|
|
1292
|
+
'GE': "greater than or equal to {}",
|
|
1293
|
+
'EQ': "equal to {}",
|
|
1294
|
+
'NE': "not equal to {}"
|
|
1295
|
+
}
|
|
1296
|
+
if not acceptable_op[op](len(arg_value), length):
|
|
1297
|
+
if isinstance(arg_value, str):
|
|
1298
|
+
raise ValueError(Messages.get_message(MessageCodes.INVALID_LENGTH_STRING_ARG,
|
|
1299
|
+
arg_name, errors[op].format(length)))
|
|
1300
|
+
raise ValueError(Messages.get_message(MessageCodes.INVALID_LENGTH_ARG, type(arg_value).__name__,
|
|
1301
|
+
arg_name, errors[op].format(length)))
|
|
1302
|
+
return True
|
|
1303
|
+
|
|
1304
|
+
@staticmethod
|
|
1305
|
+
@skip_validation()
|
|
1306
|
+
def _validate_file_exists(file_path):
|
|
1307
|
+
"""
|
|
1308
|
+
DESCRIPTION:
|
|
1309
|
+
Function to validate whether the path specified is a file and if it exists.
|
|
1310
|
+
|
|
1311
|
+
PARAMETERS:
|
|
1312
|
+
file_path:
|
|
1313
|
+
Required Argument.
|
|
1314
|
+
Specifies the path of the file.
|
|
1315
|
+
Types: str
|
|
1316
|
+
|
|
1317
|
+
RETURNS:
|
|
1318
|
+
True, if the path is a file and it exists.
|
|
1319
|
+
|
|
1320
|
+
RAISES:
|
|
1321
|
+
TeradataMLException
|
|
1322
|
+
|
|
1323
|
+
EXAMPLES:
|
|
1324
|
+
_Validators._validate_file_exists("/data/mapper.py")
|
|
1325
|
+
"""
|
|
1326
|
+
if not Path(file_path).exists() or not os.path.isfile(file_path):
|
|
1327
|
+
raise TeradataMlException(
|
|
1328
|
+
Messages.get_message(MessageCodes.INPUT_FILE_NOT_FOUND).format(file_path),
|
|
1329
|
+
MessageCodes.INPUT_FILE_NOT_FOUND)
|
|
1330
|
+
|
|
1331
|
+
return True
|
|
1332
|
+
|
|
1333
|
+
@staticmethod
|
|
1334
|
+
@skip_validation()
|
|
1335
|
+
def _validate_mutually_exclusive_arguments(arg1, err_disp_arg1_name, arg2,
|
|
1336
|
+
err_disp_arg2_name, skip_all_none_check=False):
|
|
1337
|
+
"""
|
|
1338
|
+
DESCRIPTION:
|
|
1339
|
+
Function to validate whether "arg1" and "arg2" are mutually exclusive.
|
|
1340
|
+
|
|
1341
|
+
PARAMETERS:
|
|
1342
|
+
arg1:
|
|
1343
|
+
Required Argument.
|
|
1344
|
+
Specifies the value of argument1.
|
|
1345
|
+
Types: Any
|
|
1346
|
+
|
|
1347
|
+
err_disp_arg1_name:
|
|
1348
|
+
Required Argument.
|
|
1349
|
+
Specifies the name of argument1.
|
|
1350
|
+
Types: str
|
|
1351
|
+
|
|
1352
|
+
arg2:
|
|
1353
|
+
Required Argument.
|
|
1354
|
+
Specifies the value of argument2.
|
|
1355
|
+
Types: Any
|
|
1356
|
+
|
|
1357
|
+
err_disp_arg2_name:
|
|
1358
|
+
Required Argument.
|
|
1359
|
+
Specifies the name of argument2.
|
|
1360
|
+
Types: str
|
|
1361
|
+
|
|
1362
|
+
skip_all_none_check:
|
|
1363
|
+
Optional Argument.
|
|
1364
|
+
Specifies whether to skip check when arg1 and arg2 both are None.
|
|
1365
|
+
Default Value: False
|
|
1366
|
+
Types: bool
|
|
1367
|
+
|
|
1368
|
+
RETURNS:
|
|
1369
|
+
True, if either arg1 or arg2 is None or both are None.
|
|
1370
|
+
|
|
1371
|
+
RAISES:
|
|
1372
|
+
TeradataMLException
|
|
1373
|
+
|
|
1374
|
+
EXAMPLES:
|
|
1375
|
+
_Validators._validate_mutually_exclusive_arguments(arg1, "arg1", arg2, "arg2")
|
|
1376
|
+
"""
|
|
1377
|
+
both_args_none = arg1 is None and arg2 is None
|
|
1378
|
+
if skip_all_none_check:
|
|
1379
|
+
both_args_none = False
|
|
1380
|
+
|
|
1381
|
+
# Either both the arguments are specified or both are None.
|
|
1382
|
+
if all([arg1, arg2]) or both_args_none:
|
|
1383
|
+
raise TeradataMlException(Messages.get_message(
|
|
1384
|
+
MessageCodes.EITHER_THIS_OR_THAT_ARGUMENT, err_disp_arg1_name,
|
|
1385
|
+
err_disp_arg2_name), MessageCodes.EITHER_THIS_OR_THAT_ARGUMENT)
|
|
1386
|
+
return True
|
|
1387
|
+
|
|
1388
|
+
@staticmethod
|
|
1389
|
+
@skip_validation()
|
|
1390
|
+
def _validate_unexpected_column_type(df, col, col_arg, unexpected_types, check_exist=True, raise_error=True):
|
|
1391
|
+
"""
|
|
1392
|
+
Internal function to validate the column existence and type of an input DataFrame column against
|
|
1393
|
+
a list of unexpected types.
|
|
1394
|
+
|
|
1395
|
+
PARAMETERS
|
|
1396
|
+
df:
|
|
1397
|
+
Required Argument.
|
|
1398
|
+
Specifies the input teradataml DataFrame which has the column(s) to be tested
|
|
1399
|
+
for type.
|
|
1400
|
+
Types: teradataml DataFrame
|
|
1401
|
+
|
|
1402
|
+
col:
|
|
1403
|
+
Required Argument.
|
|
1404
|
+
Specifies the column(s) in the input DataFrame to be tested for type.
|
|
1405
|
+
Types: str (or) ColumnExpression (or) List of strings(str)
|
|
1406
|
+
or ColumnExpressions
|
|
1407
|
+
|
|
1408
|
+
col_arg:
|
|
1409
|
+
Required Argument.
|
|
1410
|
+
Specifies the name of the argument used to pass the column(s) name.
|
|
1411
|
+
Types: str
|
|
1412
|
+
|
|
1413
|
+
unexpected_types:
|
|
1414
|
+
Required Argument.
|
|
1415
|
+
Specifies unsupported teradatasqlalcehmy datatypes for the column is
|
|
1416
|
+
unexpected to be of type.
|
|
1417
|
+
Types: list of SQLAlchemy types
|
|
1418
|
+
|
|
1419
|
+
check_exist:
|
|
1420
|
+
Optional Argument.
|
|
1421
|
+
Specifies a boolean flag that decides whether to check for column is
|
|
1422
|
+
existed in DataFrame or not.
|
|
1423
|
+
Default Values: True, raise exception if column is not of desired type.
|
|
1424
|
+
Types: bool
|
|
1425
|
+
|
|
1426
|
+
raise_error:
|
|
1427
|
+
Optional Argument.
|
|
1428
|
+
Specifies a boolean flag that decides whether to raise error or just return True or False.
|
|
1429
|
+
Default Values: True, raise exception if column is not of desired type.
|
|
1430
|
+
Types: bool
|
|
1431
|
+
|
|
1432
|
+
RETURNS:
|
|
1433
|
+
True, when the columns is of an expected type.
|
|
1434
|
+
|
|
1435
|
+
RAISES:
|
|
1436
|
+
TeradataMlException, when the columns is not one of the expected types.
|
|
1437
|
+
|
|
1438
|
+
EXAMPLES:
|
|
1439
|
+
_Validators._validate_unexpected_column_type(
|
|
1440
|
+
df, timecode_column, 'timecode_column', PTITableConstants.VALID_TIMECODE_DATATYPES)
|
|
1441
|
+
"""
|
|
1442
|
+
|
|
1443
|
+
columns = [col] if not isinstance(col, list) else col
|
|
1444
|
+
|
|
1445
|
+
# Converting "unexpected_types" to tuple as isinstance can accept Tuple
|
|
1446
|
+
# of types too.
|
|
1447
|
+
unexpected_types = tuple(unexpected_types)
|
|
1448
|
+
|
|
1449
|
+
for col in columns:
|
|
1450
|
+
# Get the name of the column if "col" is ColumnExpression.
|
|
1451
|
+
if not isinstance(col, str):
|
|
1452
|
+
col = col.name
|
|
1453
|
+
|
|
1454
|
+
# Check for column existence.
|
|
1455
|
+
if check_exist:
|
|
1456
|
+
_Validators._validate_column_exists_in_dataframe(col, df._metaexpr)
|
|
1457
|
+
|
|
1458
|
+
if isinstance(df[col].type, unexpected_types):
|
|
1459
|
+
if raise_error:
|
|
1460
|
+
invalid_column_types = (col_type.__name__ for col_type in
|
|
1461
|
+
unexpected_types)
|
|
1462
|
+
error_message = Messages.get_message(MessageCodes.INVALID_COLUMN_DATATYPE,
|
|
1463
|
+
col,
|
|
1464
|
+
col_arg,
|
|
1465
|
+
"Unsupported",
|
|
1466
|
+
", ".join(invalid_column_types))
|
|
1467
|
+
raise TeradataMlException(error_message, MessageCodes.INVALID_COLUMN_DATATYPE)
|
|
1468
|
+
|
|
1469
|
+
else:
|
|
1470
|
+
return False
|
|
1471
|
+
|
|
1472
|
+
return True
|
|
1473
|
+
|
|
1474
|
+
@staticmethod
|
|
1475
|
+
@skip_validation()
|
|
1476
|
+
def _validate_dependent_argument(dependent_arg, dependent_arg_value, independent_arg, independent_arg_value,
|
|
1477
|
+
msg_arg_value=None):
|
|
1478
|
+
"""
|
|
1479
|
+
DESCRIPTION:
|
|
1480
|
+
Function validates if an independent argument is specified or not when
|
|
1481
|
+
dependent argument is specified. Raises error, if independent argument
|
|
1482
|
+
is not specified and dependent argument is specified, otherwise returns True.
|
|
1483
|
+
|
|
1484
|
+
PARAMETERS:
|
|
1485
|
+
dependent_arg:
|
|
1486
|
+
Required Argument.
|
|
1487
|
+
Specifies the name of dependent argument.
|
|
1488
|
+
Types: String
|
|
1489
|
+
|
|
1490
|
+
dependent_arg_value:
|
|
1491
|
+
Required Argument.
|
|
1492
|
+
Specifies the value of dependent argument.
|
|
1493
|
+
Types: Any
|
|
1494
|
+
|
|
1495
|
+
independent_arg:
|
|
1496
|
+
Required Argument.
|
|
1497
|
+
Specifies the name of independent argument.
|
|
1498
|
+
Types: String
|
|
1499
|
+
|
|
1500
|
+
independent_arg_value:
|
|
1501
|
+
Required Argument.
|
|
1502
|
+
Specifies the value of independent argument.
|
|
1503
|
+
Types: Any
|
|
1504
|
+
|
|
1505
|
+
msg_arg_value:
|
|
1506
|
+
Optional Argument.
|
|
1507
|
+
Specifies the independent argument value to be printed in message
|
|
1508
|
+
instead of "(not None)".
|
|
1509
|
+
Types: String
|
|
1510
|
+
|
|
1511
|
+
RETURNS:
|
|
1512
|
+
True, when the independent argument is present for the dependent
|
|
1513
|
+
argument.
|
|
1514
|
+
|
|
1515
|
+
RAISES:
|
|
1516
|
+
TeradataMlException, when independent argument is not specified and
|
|
1517
|
+
dependent argument is specified.
|
|
1518
|
+
|
|
1519
|
+
EXAMPLES:
|
|
1520
|
+
_Validators._validate_dependent_argument("dependent_arg_name", admissions_train,
|
|
1521
|
+
"independent_arg_name", None)
|
|
1522
|
+
_Validators._validate_dependent_argument("dependent_arg_name", None,
|
|
1523
|
+
"independent_arg_name", admissions_train)
|
|
1524
|
+
_Validators._validate_dependent_argument("dependent_arg_name", admissions_train,
|
|
1525
|
+
"independent_arg_name", admissions_train)
|
|
1526
|
+
_Validators._validate_dependent_argument("dependent_arg_name", admissions_train,
|
|
1527
|
+
"independent_arg_name", admissions_train,
|
|
1528
|
+
"arg_val")
|
|
1529
|
+
"""
|
|
1530
|
+
if dependent_arg_value is not None and independent_arg_value is None:
|
|
1531
|
+
error_code = MessageCodes.DEPENDENT_ARGUMENT
|
|
1532
|
+
error_msg = Messages.get_message(error_code, dependent_arg, independent_arg)
|
|
1533
|
+
if msg_arg_value is None:
|
|
1534
|
+
raise TeradataMlException(error_msg, error_code)
|
|
1535
|
+
else:
|
|
1536
|
+
raise TeradataMlException(error_msg.replace("(not None)", "as '{}'".format(msg_arg_value)),
|
|
1537
|
+
MessageCodes.DEPENDENT_ARGUMENT)
|
|
1538
|
+
return True
|
|
1539
|
+
|
|
1540
|
+
@staticmethod
|
|
1541
|
+
@skip_validation()
|
|
1542
|
+
def _validate_py_type_for_td_type_conversion(py_type, py_type_arg_name):
|
|
1543
|
+
"""
|
|
1544
|
+
DESCRIPTION:
|
|
1545
|
+
Function to validate python type, which needs to be converted to TD Type.
|
|
1546
|
+
This function checks whether the python type can be converted to a TD
|
|
1547
|
+
type or not. If PY type is not able to convert TD Type, it then raises
|
|
1548
|
+
an error.
|
|
1549
|
+
|
|
1550
|
+
PARAMETERS:
|
|
1551
|
+
py_type:
|
|
1552
|
+
Required Argument.
|
|
1553
|
+
Specifies the python type.
|
|
1554
|
+
Types: Any
|
|
1555
|
+
|
|
1556
|
+
py_type_arg_name:
|
|
1557
|
+
Required Argument.
|
|
1558
|
+
Specifies the name of argument which holds python variable.
|
|
1559
|
+
Types: str
|
|
1560
|
+
|
|
1561
|
+
RETURNS:
|
|
1562
|
+
None
|
|
1563
|
+
|
|
1564
|
+
RAISES:
|
|
1565
|
+
TeradataMLException
|
|
1566
|
+
|
|
1567
|
+
EXAMPLES:
|
|
1568
|
+
_Validators._validate_py_type_for_td_type_conversion(int, "arg1")
|
|
1569
|
+
"""
|
|
1570
|
+
if py_type not in _DtypesMappers.PY_TD_MAPPER:
|
|
1571
|
+
error_code = MessageCodes.UNSUPPORTED_DATATYPE
|
|
1572
|
+
error_msg = Messages.get_message(
|
|
1573
|
+
error_code, py_type_arg_name, '[{}]'.format(", ".join((t.__name__ for t in _DtypesMappers.PY_TD_MAPPER))))
|
|
1574
|
+
raise TeradataMlException(error_msg, error_code)
|
|
1575
|
+
|
|
1576
|
+
@staticmethod
|
|
1577
|
+
@skip_validation()
|
|
1578
|
+
def _validate_function_install_location_is_set(option, function_type, option_name):
|
|
1579
|
+
"""
|
|
1580
|
+
DESCRIPTION:
|
|
1581
|
+
Function to validate whether install location for functions is set.
|
|
1582
|
+
|
|
1583
|
+
PARAMETERS:
|
|
1584
|
+
option:
|
|
1585
|
+
Required Argument.
|
|
1586
|
+
Specifies the configuration option value to validate.
|
|
1587
|
+
Types: str
|
|
1588
|
+
|
|
1589
|
+
function_type:
|
|
1590
|
+
Required Argument.
|
|
1591
|
+
Specifies the type of function to check installed location for.
|
|
1592
|
+
Types: str
|
|
1593
|
+
|
|
1594
|
+
option_name:
|
|
1595
|
+
Required Argument.
|
|
1596
|
+
Specifies the configuration option name.
|
|
1597
|
+
Types: str
|
|
1598
|
+
|
|
1599
|
+
RETURNS:
|
|
1600
|
+
None
|
|
1601
|
+
|
|
1602
|
+
RAISES:
|
|
1603
|
+
TeradataMLException
|
|
1604
|
+
|
|
1605
|
+
EXAMPLES:
|
|
1606
|
+
_Validators._validate_function_install_location_is_set(
|
|
1607
|
+
configure.byom_install_location,
|
|
1608
|
+
"Bring Your Own Model",
|
|
1609
|
+
"configure.byom_install_location")
|
|
1610
|
+
"""
|
|
1611
|
+
# Check whether an empty string is passed to "option".
|
|
1612
|
+
_Validators._validate_input_columns_not_empty(option, option_name)
|
|
1613
|
+
|
|
1614
|
+
if option is None:
|
|
1615
|
+
message = Messages.get_message(MessageCodes.UNKNOWN_INSTALL_LOCATION,
|
|
1616
|
+
"{} functions".format(function_type),
|
|
1617
|
+
"option '{}'".format(option_name))
|
|
1618
|
+
raise TeradataMlException(message, MessageCodes.MISSING_ARGS)
|
|
1619
|
+
|
|
1620
|
+
@staticmethod
|
|
1621
|
+
@skip_validation()
|
|
1622
|
+
def _check_table_exists(conn, table_name,
|
|
1623
|
+
schema_name,
|
|
1624
|
+
raise_error_if_does_not_exists=True,
|
|
1625
|
+
additional_error=''):
|
|
1626
|
+
"""
|
|
1627
|
+
DESCRIPTION:
|
|
1628
|
+
Check whether table specified exists or not.
|
|
1629
|
+
|
|
1630
|
+
PARAMETERS:
|
|
1631
|
+
raise_error_if_does_not_exists:
|
|
1632
|
+
Optional Argument.
|
|
1633
|
+
Specifies the flag to decide whether to raise error when table name specified does not exist.
|
|
1634
|
+
Default Value: True (Raise exception)
|
|
1635
|
+
Types: bool
|
|
1636
|
+
|
|
1637
|
+
additional_error:
|
|
1638
|
+
Optional Argument.
|
|
1639
|
+
Specifies the additional error message to display along with standard message.
|
|
1640
|
+
Default Value: ''
|
|
1641
|
+
Types: String
|
|
1642
|
+
|
|
1643
|
+
RAISES:
|
|
1644
|
+
TeradataMlException.
|
|
1645
|
+
|
|
1646
|
+
RETURNS:
|
|
1647
|
+
True, if table exists, else False.
|
|
1648
|
+
|
|
1649
|
+
EXAMPLES:
|
|
1650
|
+
>>> _check_table_exists('model_table_name','model_schema_name')
|
|
1651
|
+
"""
|
|
1652
|
+
|
|
1653
|
+
# Check whether table exists on the system or not.
|
|
1654
|
+
table_exists = conn.dialect.has_table(conn, table_name=table_name,
|
|
1655
|
+
schema=schema_name)
|
|
1656
|
+
|
|
1657
|
+
# If tables exists, return True.
|
|
1658
|
+
if table_exists:
|
|
1659
|
+
return True
|
|
1660
|
+
|
|
1661
|
+
# We are here means the specified table does not exist.
|
|
1662
|
+
# Let's raise error if 'raise_error_if_does_not_exists' set to True.
|
|
1663
|
+
if raise_error_if_does_not_exists:
|
|
1664
|
+
# Raise error, as the specified table_name does not exist.
|
|
1665
|
+
# TABLE_DOES_NOT_EXIST
|
|
1666
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.TABLE_DOES_NOT_EXIST,
|
|
1667
|
+
schema_name, table_name, additional_error),
|
|
1668
|
+
MessageCodes.TABLE_DOES_NOT_EXIST)
|
|
1669
|
+
return False
|
|
1670
|
+
|
|
1671
|
+
@staticmethod
|
|
1672
|
+
@skip_validation()
|
|
1673
|
+
def _check_empty_file(file_path):
|
|
1674
|
+
"""
|
|
1675
|
+
Description:
|
|
1676
|
+
Function to validate whether the given file is not empty,
|
|
1677
|
+
given absolute file path.
|
|
1678
|
+
|
|
1679
|
+
PARAMETERS:
|
|
1680
|
+
file_path:
|
|
1681
|
+
Required Argument.
|
|
1682
|
+
Specifies absolute file path of the file.
|
|
1683
|
+
Types: str
|
|
1684
|
+
|
|
1685
|
+
RETURNS:
|
|
1686
|
+
Boolean
|
|
1687
|
+
|
|
1688
|
+
RAISES:
|
|
1689
|
+
TeradataMlException
|
|
1690
|
+
|
|
1691
|
+
EXAMPLES:
|
|
1692
|
+
_check_empty_file("/abc/xyz.txt")
|
|
1693
|
+
"""
|
|
1694
|
+
|
|
1695
|
+
if os.stat(file_path).st_size == 0:
|
|
1696
|
+
raise TeradataMlException(
|
|
1697
|
+
Messages.get_message(MessageCodes.EMPTY_FILE,
|
|
1698
|
+
"{}".format(file_path)),
|
|
1699
|
+
MessageCodes.EMPTY_FILE)
|
|
1700
|
+
return True
|
|
1701
|
+
|
|
1702
|
+
@staticmethod
|
|
1703
|
+
@skip_validation()
|
|
1704
|
+
def _validate_mutually_inclusive_arguments(arg1, err_disp_arg1_name, arg2,
|
|
1705
|
+
err_disp_arg2_name):
|
|
1706
|
+
"""
|
|
1707
|
+
DESCRIPTION:
|
|
1708
|
+
Function to validate whether "arg1" and "arg2" are mutually inclusive.
|
|
1709
|
+
|
|
1710
|
+
PARAMETERS:
|
|
1711
|
+
arg1:
|
|
1712
|
+
Required Argument.
|
|
1713
|
+
Specifies the value of argument1.
|
|
1714
|
+
Types: Any
|
|
1715
|
+
|
|
1716
|
+
err_disp_arg1_name:
|
|
1717
|
+
Required Argument.
|
|
1718
|
+
Specifies the name of argument1.
|
|
1719
|
+
Types: str
|
|
1720
|
+
|
|
1721
|
+
arg2:
|
|
1722
|
+
Required Argument.
|
|
1723
|
+
Specifies the value of argument2.
|
|
1724
|
+
Types: Any
|
|
1725
|
+
|
|
1726
|
+
err_disp_arg2_name:
|
|
1727
|
+
Required Argument.
|
|
1728
|
+
Specifies the name of argument2.
|
|
1729
|
+
Types: str
|
|
1730
|
+
|
|
1731
|
+
RETURNS:
|
|
1732
|
+
True, if both arg1 and arg2 are present or both are None.
|
|
1733
|
+
|
|
1734
|
+
RAISES:
|
|
1735
|
+
TeradataMLException
|
|
1736
|
+
|
|
1737
|
+
EXAMPLES:
|
|
1738
|
+
_Validators._validate_mutually_inclusive_arguments(arg1, "arg1", arg2, "arg2")
|
|
1739
|
+
"""
|
|
1740
|
+
both_args_none = arg1 is None and arg2 is None
|
|
1741
|
+
# If below handles 0 value.
|
|
1742
|
+
# 0 turns to False using bool(0) but 0 is a valid value and should return True.
|
|
1743
|
+
arg1 = True if arg1 == 0 else bool(arg1)
|
|
1744
|
+
arg2 = True if arg2 == 0 else bool(arg2)
|
|
1745
|
+
|
|
1746
|
+
# Either both the arguments are specified or both are None.
|
|
1747
|
+
if not(all([arg1, arg2]) or both_args_none):
|
|
1748
|
+
arg_order = [err_disp_arg1_name, err_disp_arg2_name] if arg1 \
|
|
1749
|
+
else [err_disp_arg2_name, err_disp_arg1_name]
|
|
1750
|
+
raise TeradataMlException(Messages.get_message(
|
|
1751
|
+
MessageCodes.DEPENDENT_ARGUMENT, arg_order[0],
|
|
1752
|
+
arg_order[1]), MessageCodes.DEPENDENT_ARGUMENT)
|
|
1753
|
+
return True
|
|
1754
|
+
|
|
1755
|
+
@staticmethod
|
|
1756
|
+
@skip_validation()
|
|
1757
|
+
def _validate_file_extension(file_path, extension):
|
|
1758
|
+
"""
|
|
1759
|
+
DESCRIPTION:
|
|
1760
|
+
Function to validate whether the file has a specified extension.
|
|
1761
|
+
|
|
1762
|
+
PARAMETERS:
|
|
1763
|
+
file_path:
|
|
1764
|
+
Required Argument.
|
|
1765
|
+
Specifies the file path or file name.
|
|
1766
|
+
Types: str
|
|
1767
|
+
|
|
1768
|
+
extension:
|
|
1769
|
+
Required Argument.
|
|
1770
|
+
Specifies the extension of the file.
|
|
1771
|
+
Types: str OR list of Strings (str)
|
|
1772
|
+
|
|
1773
|
+
RETURNS:
|
|
1774
|
+
True, if the file has specified extension.
|
|
1775
|
+
|
|
1776
|
+
RAISES:
|
|
1777
|
+
TeradataMLException
|
|
1778
|
+
|
|
1779
|
+
EXAMPLES:
|
|
1780
|
+
|
|
1781
|
+
_Validators._validate_file_extension("/data/mapper.py",".py")
|
|
1782
|
+
_Validators._validate_file_extension("ml__demoenv_requirements_1605727131624097.txt",".txt")
|
|
1783
|
+
"""
|
|
1784
|
+
extension = extension if isinstance(extension, list) else[extension]
|
|
1785
|
+
file_extension = file_path.lower().split('.')[-1]
|
|
1786
|
+
if file_extension not in extension:
|
|
1787
|
+
raise TeradataMlException(
|
|
1788
|
+
Messages.get_message(MessageCodes.UNSUPPORTED_FILE_EXTENSION).format("{}".format(extension)),
|
|
1789
|
+
MessageCodes.UNSUPPORTED_FILE_EXTENSION)
|
|
1790
|
+
|
|
1791
|
+
return True
|
|
1792
|
+
|
|
1793
|
+
|
|
1794
|
+
@staticmethod
|
|
1795
|
+
@skip_validation()
|
|
1796
|
+
def _validate_argument_is_not_None(arg, arg_name, additional_error="", reverse=False):
|
|
1797
|
+
"""
|
|
1798
|
+
DESCRIPTION:
|
|
1799
|
+
Check whether the argument provided is not None.
|
|
1800
|
+
If parameter reverse is set to True, the validation is reversed to
|
|
1801
|
+
check whether argument provided is None.
|
|
1802
|
+
|
|
1803
|
+
PARAMETERS:
|
|
1804
|
+
arg:
|
|
1805
|
+
Required Argument.
|
|
1806
|
+
Specifies the argument to be validated.
|
|
1807
|
+
Types: str
|
|
1808
|
+
|
|
1809
|
+
arg_name:
|
|
1810
|
+
Required Argument.
|
|
1811
|
+
Specifies the name of the argument to be printed in error message.
|
|
1812
|
+
Types: str
|
|
1813
|
+
|
|
1814
|
+
additional_error:
|
|
1815
|
+
Optional Argument.
|
|
1816
|
+
Specifies the additional error message to display along with standard message.
|
|
1817
|
+
Default value=""
|
|
1818
|
+
Types: str
|
|
1819
|
+
|
|
1820
|
+
reverse:
|
|
1821
|
+
Optional Argument.
|
|
1822
|
+
Specifies whether to reverse the validation.
|
|
1823
|
+
Returns True if arg is None, False if arg is not None.
|
|
1824
|
+
Default value=False
|
|
1825
|
+
Types: bool
|
|
1826
|
+
|
|
1827
|
+
|
|
1828
|
+
RAISES:
|
|
1829
|
+
ValueError.
|
|
1830
|
+
|
|
1831
|
+
RETURNS:
|
|
1832
|
+
True, if the argument is not None, else False.
|
|
1833
|
+
|
|
1834
|
+
EXAMPLES:
|
|
1835
|
+
>>> _validate_argument_is_not_None(table_name, "table_name", additional_error)
|
|
1836
|
+
"""
|
|
1837
|
+
if not reverse:
|
|
1838
|
+
# Raise an error if the argument is None.
|
|
1839
|
+
if arg is None:
|
|
1840
|
+
raise ValueError(Messages.get_message(MessageCodes.ARG_NONE, arg_name, "None", additional_error))
|
|
1841
|
+
return True
|
|
1842
|
+
else:
|
|
1843
|
+
# Raise an error if the argument is not None.
|
|
1844
|
+
if arg is not None:
|
|
1845
|
+
raise ValueError(Messages.get_message(MessageCodes.ARG_NONE, arg_name,
|
|
1846
|
+
"provided {}".format(additional_error), ""))
|
|
1847
|
+
return True
|
|
1848
|
+
|
|
1849
|
+
|
|
1850
|
+
@staticmethod
|
|
1851
|
+
@skip_validation()
|
|
1852
|
+
def _validate_dataframe(df, raise_error=True):
|
|
1853
|
+
"""
|
|
1854
|
+
This is an internal function checks whether the dataframe is none
|
|
1855
|
+
or not. If not none then checks the dataframe type and length of columns.
|
|
1856
|
+
|
|
1857
|
+
PARAMETERS:
|
|
1858
|
+
df:
|
|
1859
|
+
Required Argument.
|
|
1860
|
+
Specifies the dataframe.
|
|
1861
|
+
Types: pandas.DataFrame or teradataml.dataframe.dataframe.DataFrame
|
|
1862
|
+
|
|
1863
|
+
raise_error:
|
|
1864
|
+
Optional Argument.
|
|
1865
|
+
Specifies whether to raise an exception or not.
|
|
1866
|
+
Default Values: True
|
|
1867
|
+
Types: bool
|
|
1868
|
+
|
|
1869
|
+
RETURNS:
|
|
1870
|
+
None
|
|
1871
|
+
|
|
1872
|
+
RAISES:
|
|
1873
|
+
TeradataMlException
|
|
1874
|
+
|
|
1875
|
+
EXAMPLES:
|
|
1876
|
+
_validate_dataframe(df)
|
|
1877
|
+
|
|
1878
|
+
"""
|
|
1879
|
+
from teradataml.dataframe import dataframe as tdmldf
|
|
1880
|
+
|
|
1881
|
+
valid = False
|
|
1882
|
+
if df is not None:
|
|
1883
|
+
if isinstance(df, pd.DataFrame) and len(df.columns) > 0:
|
|
1884
|
+
valid = True
|
|
1885
|
+
elif isinstance(df, tdmldf.DataFrame) and len(df._metaexpr.c) > 0:
|
|
1886
|
+
valid = True
|
|
1887
|
+
else:
|
|
1888
|
+
valid = False
|
|
1889
|
+
|
|
1890
|
+
if raise_error and not valid:
|
|
1891
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.IS_NOT_VALID_DF),
|
|
1892
|
+
MessageCodes.IS_NOT_VALID_DF)
|
|
1893
|
+
|
|
1894
|
+
|
|
1895
|
+
@staticmethod
|
|
1896
|
+
@skip_validation()
|
|
1897
|
+
def _validate_column_value_length(argument_name, argument_value, allowed_length,
|
|
1898
|
+
operation='perform the operation'):
|
|
1899
|
+
"""
|
|
1900
|
+
DESCRIPTION:
|
|
1901
|
+
Function to validate length of string against permitted value.
|
|
1902
|
+
|
|
1903
|
+
PARAMETERS:
|
|
1904
|
+
argument_name:
|
|
1905
|
+
Required Argument.
|
|
1906
|
+
Specifies the name of the argument whose value
|
|
1907
|
+
will be checked against permitted length.
|
|
1908
|
+
This is used while raising an error.
|
|
1909
|
+
Types: str.
|
|
1910
|
+
|
|
1911
|
+
argument_value:
|
|
1912
|
+
Required Argument.
|
|
1913
|
+
Specifies the string whose length will be checked against permitted length.
|
|
1914
|
+
Types: str.
|
|
1915
|
+
|
|
1916
|
+
allowed_length:
|
|
1917
|
+
Required Argument.
|
|
1918
|
+
Specifies the allowed length for argument value.
|
|
1919
|
+
Types: int.
|
|
1920
|
+
|
|
1921
|
+
operation:
|
|
1922
|
+
Optional Argument.
|
|
1923
|
+
Specifies the name of operation which will fail, if this check fails.
|
|
1924
|
+
Default value: 'perform the operation'.
|
|
1925
|
+
Types: str.
|
|
1926
|
+
|
|
1927
|
+
RETURNS:
|
|
1928
|
+
None.
|
|
1929
|
+
|
|
1930
|
+
RAISES:
|
|
1931
|
+
TeradataMlException - EXECUTION_FAILED, ValueError
|
|
1932
|
+
|
|
1933
|
+
EXAMPLES:
|
|
1934
|
+
>>> _validate_column_value_length("Description", "KMeans model", 150, "save the model")
|
|
1935
|
+
"""
|
|
1936
|
+
try:
|
|
1937
|
+
_Validators._validate_str_arg_length(argument_name, argument_value, 'LE', allowed_length)
|
|
1938
|
+
except ValueError:
|
|
1939
|
+
error_code = MessageCodes.EXECUTION_FAILED
|
|
1940
|
+
error_msg = Messages.get_message(
|
|
1941
|
+
error_code, operation,
|
|
1942
|
+
'Length of argument {0} ({1}) is more than the allowed length ({2}).'
|
|
1943
|
+
.format(argument_name, len(argument_value), allowed_length))
|
|
1944
|
+
raise TeradataMlException(error_msg, error_code)
|
|
1945
|
+
return True
|
|
1946
|
+
|
|
1947
|
+
|
|
1948
|
+
@staticmethod
|
|
1949
|
+
@skip_validation()
|
|
1950
|
+
def _validate_list_lengths_equal(list1, arg_name1, list2, arg_name2):
|
|
1951
|
+
"""
|
|
1952
|
+
DESCRIPTION:
|
|
1953
|
+
Check if length of the lists is same or not.
|
|
1954
|
+
|
|
1955
|
+
PARAMETERS:
|
|
1956
|
+
list1:
|
|
1957
|
+
Required Argument.
|
|
1958
|
+
Specifies the first list to check the length against "list2".
|
|
1959
|
+
Types: list
|
|
1960
|
+
|
|
1961
|
+
arg_name1:
|
|
1962
|
+
Required Argument.
|
|
1963
|
+
Specifies the name of the argument that accepts "list1" as input.
|
|
1964
|
+
This is used while raising an error.
|
|
1965
|
+
Types: str
|
|
1966
|
+
|
|
1967
|
+
list2:
|
|
1968
|
+
Required Argument.
|
|
1969
|
+
Specifies the second list to check the length against "list1".
|
|
1970
|
+
Types: list
|
|
1971
|
+
|
|
1972
|
+
arg_name2:
|
|
1973
|
+
Required Argument.
|
|
1974
|
+
Specifies the name of the argument that accepts "list2" as input.
|
|
1975
|
+
This is used while raising an error.
|
|
1976
|
+
Types: str
|
|
1977
|
+
|
|
1978
|
+
RETURNS:
|
|
1979
|
+
None.
|
|
1980
|
+
|
|
1981
|
+
RAISES:
|
|
1982
|
+
ValueError
|
|
1983
|
+
|
|
1984
|
+
EXAMPLES:
|
|
1985
|
+
_Validators._validate_list_lengths_equal(self.coordinates, "coordinates",
|
|
1986
|
+
self.timestamps, "timestamps")
|
|
1987
|
+
"""
|
|
1988
|
+
if len(list1) != len(list2):
|
|
1989
|
+
# Raise error, if length of both lists is not same.
|
|
1990
|
+
err_ = Messages.get_message(MessageCodes.INVALID_LENGTH_ARGS,
|
|
1991
|
+
"'{}' and '{}'".format(arg_name1, arg_name2))
|
|
1992
|
+
raise ValueError(err_)
|
|
1993
|
+
return True
|
|
1994
|
+
|
|
1995
|
+
@staticmethod
|
|
1996
|
+
@skip_validation()
|
|
1997
|
+
def _validate_dict_argument_key_value(arg_name, arg_dict, key_types=None, value_types=None,
|
|
1998
|
+
key_permitted_values=None, value_permitted_values=None,
|
|
1999
|
+
value_empty_string=True):
|
|
2000
|
+
"""
|
|
2001
|
+
DESCRIPTION:
|
|
2002
|
+
Internal function to validate type and permitted values
|
|
2003
|
+
for keys and values in a dictionary argument.
|
|
2004
|
+
|
|
2005
|
+
PARAMETERS:
|
|
2006
|
+
arg_name:
|
|
2007
|
+
Required Argument.
|
|
2008
|
+
Specifies the name of the dictionary argument.
|
|
2009
|
+
Types: str
|
|
2010
|
+
|
|
2011
|
+
arg_dict:
|
|
2012
|
+
Required Argument.
|
|
2013
|
+
Specifies the dictonary value of "arg_name".
|
|
2014
|
+
Types: dict
|
|
2015
|
+
|
|
2016
|
+
key_types:
|
|
2017
|
+
Optional Argument.
|
|
2018
|
+
Specifies the types, 'keys' of the "arg_dict" can take.
|
|
2019
|
+
Types: Any type or tuple of types
|
|
2020
|
+
|
|
2021
|
+
value_types:
|
|
2022
|
+
Optional Argument.
|
|
2023
|
+
Specifies the types, 'values' assigned to 'keys' of
|
|
2024
|
+
"arg_dict" can take.
|
|
2025
|
+
Types: Any type or tuple of types
|
|
2026
|
+
|
|
2027
|
+
key_permitted_values:
|
|
2028
|
+
Optional Argument.
|
|
2029
|
+
Specifies the permitted values for the 'keys' of "arg_dict".
|
|
2030
|
+
Types: list
|
|
2031
|
+
|
|
2032
|
+
value_permitted_values:
|
|
2033
|
+
Optional Argument.
|
|
2034
|
+
Specifies the permitted values for the 'values' assgined to 'keys'
|
|
2035
|
+
of "arg_dict".
|
|
2036
|
+
Types: list
|
|
2037
|
+
|
|
2038
|
+
value_empty_string:
|
|
2039
|
+
Optional Argument.
|
|
2040
|
+
Specifies the whether 'values' assigned to 'keys' of "arg_dict"
|
|
2041
|
+
can accept empty string.
|
|
2042
|
+
Set to True, dictionary value with empty string is accepted.
|
|
2043
|
+
Set to False, dictionary value with empty string is not accepted.
|
|
2044
|
+
Default Value: True
|
|
2045
|
+
Types: bool
|
|
2046
|
+
|
|
2047
|
+
RETURNS:
|
|
2048
|
+
bool
|
|
2049
|
+
|
|
2050
|
+
RAISES:
|
|
2051
|
+
TypeError, ValueError
|
|
2052
|
+
|
|
2053
|
+
EXAMPLES:
|
|
2054
|
+
_Validators._validate_dict_argument_key_value("name", {"a":3, "b":4}, (str), (int))
|
|
2055
|
+
_Validators._validate_dict_argument_key_value(arg_name="columns", arg_dict=columns,
|
|
2056
|
+
key_types=(ColumnExpression, _TupleOf(ColumnExpression)),
|
|
2057
|
+
value_types=(str, int, float, NoneType))
|
|
2058
|
+
|
|
2059
|
+
"""
|
|
2060
|
+
info_matrix = []
|
|
2061
|
+
dict_keys_list = set()
|
|
2062
|
+
from teradataml.common.utils import UtilFuncs
|
|
2063
|
+
|
|
2064
|
+
try:
|
|
2065
|
+
for key, value in arg_dict.items():
|
|
2066
|
+
# Validate duplicate keys exists or not.
|
|
2067
|
+
# If keys are not of type tuple, convert it to tuple.
|
|
2068
|
+
keys_list = (key,) if not isinstance(key, tuple) else key
|
|
2069
|
+
|
|
2070
|
+
# If duplicate key exists raise exception. E.g.
|
|
2071
|
+
# di = {("key1", "key2"): "my_keys1",
|
|
2072
|
+
# ("key1", "key3"): "my_keys2",
|
|
2073
|
+
# "key2" : "my_keys3"}
|
|
2074
|
+
for k in keys_list:
|
|
2075
|
+
# If ColumnExpression, get the column name.
|
|
2076
|
+
if isinstance(k, ColumnExpression):
|
|
2077
|
+
k_name, name = k.name, "ColumnExpression(s)"
|
|
2078
|
+
else:
|
|
2079
|
+
k_name, name = k, "Key names"
|
|
2080
|
+
|
|
2081
|
+
# If duplicate key exists raise exception.
|
|
2082
|
+
if k_name in dict_keys_list:
|
|
2083
|
+
raise TeradataMlException(Messages.get_message(
|
|
2084
|
+
MessageCodes.DUPLICATE_DICT_KEYS_NAMES,
|
|
2085
|
+
name, arg_name),
|
|
2086
|
+
MessageCodes.DUPLICATE_PARAMETER)
|
|
2087
|
+
else:
|
|
2088
|
+
dict_keys_list.add(k_name)
|
|
2089
|
+
|
|
2090
|
+
# Append "keys" and "values" into arg info matrix for type validation.
|
|
2091
|
+
if key_types is not None:
|
|
2092
|
+
info_matrix.append(["<dict_key>", key, True, key_types, True])
|
|
2093
|
+
|
|
2094
|
+
if value_types is not None:
|
|
2095
|
+
info_matrix.append(
|
|
2096
|
+
["<dict_value>", value, True, value_types, not value_empty_string])
|
|
2097
|
+
|
|
2098
|
+
# Validate permitted values for both "key" and "value" if permitted values
|
|
2099
|
+
# are provided.
|
|
2100
|
+
if key_permitted_values is not None:
|
|
2101
|
+
_Validators._validate_permitted_values(arg=key,
|
|
2102
|
+
permitted_values=key_permitted_values,
|
|
2103
|
+
arg_name="<dict_key>",
|
|
2104
|
+
case_insensitive=False,
|
|
2105
|
+
includeNone=True)
|
|
2106
|
+
|
|
2107
|
+
if value_permitted_values is not None:
|
|
2108
|
+
_Validators._validate_permitted_values(arg=value,
|
|
2109
|
+
permitted_values=value_permitted_values,
|
|
2110
|
+
arg_name="<dict_value>",
|
|
2111
|
+
case_insensitive=False,
|
|
2112
|
+
includeNone=True)
|
|
2113
|
+
|
|
2114
|
+
if key_types is not None or value_types is not None:
|
|
2115
|
+
# Validate types using already existing validator.
|
|
2116
|
+
_Validators._validate_function_arguments(info_matrix)
|
|
2117
|
+
|
|
2118
|
+
except ValueError as ve:
|
|
2119
|
+
# Catch ValueError raised by '_validate_permitted_values' to
|
|
2120
|
+
# raise proper error message for dictionary argument.
|
|
2121
|
+
if "TDML_2007" in str(ve):
|
|
2122
|
+
permitted_values = value_permitted_values
|
|
2123
|
+
err_str = "value"
|
|
2124
|
+
err_val = value
|
|
2125
|
+
if "<dict_key>" in str(ve):
|
|
2126
|
+
permitted_values = key_permitted_values
|
|
2127
|
+
err_str = "key"
|
|
2128
|
+
err_val = key
|
|
2129
|
+
raise ValueError(
|
|
2130
|
+
Messages.get_message(MessageCodes.INVALID_DICT_ARG_VALUE, err_val,
|
|
2131
|
+
err_str, arg_name, permitted_values))
|
|
2132
|
+
|
|
2133
|
+
# Catch ValueError raised by '_validate_function_arguments'
|
|
2134
|
+
# for empty string value.
|
|
2135
|
+
elif "TDML_2004" in str(ve):
|
|
2136
|
+
err_str = "Key" if "<dict_key>" in str(ve) else "Value"
|
|
2137
|
+
raise ValueError(
|
|
2138
|
+
Messages.get_message(MessageCodes.DICT_ARG_KEY_VALUE_EMPTY,
|
|
2139
|
+
err_str, arg_name))
|
|
2140
|
+
|
|
2141
|
+
except TypeError as te:
|
|
2142
|
+
# Catch TypeError raised by '_validate_function_arguments' to
|
|
2143
|
+
# raise proper error message for dictionary argument.
|
|
2144
|
+
permitted_types = value_types
|
|
2145
|
+
err_str = "value"
|
|
2146
|
+
if "<dict_key>" in str(te):
|
|
2147
|
+
permitted_types = key_types
|
|
2148
|
+
err_str = "key"
|
|
2149
|
+
|
|
2150
|
+
permitted_types = [''.join(_Validators.__getTypeAsStr(kv_type))
|
|
2151
|
+
if isinstance(kv_type, (_TupleOf, _ListOf)) else
|
|
2152
|
+
kv_type.__name__ for kv_type in permitted_types]
|
|
2153
|
+
|
|
2154
|
+
raise TypeError(
|
|
2155
|
+
Messages.get_message(MessageCodes.UNSUPPORTED_DICT_KEY_VALUE_DTYPE, err_str,
|
|
2156
|
+
arg_name, permitted_types))
|
|
2157
|
+
|
|
2158
|
+
return True
|
|
2159
|
+
|
|
2160
|
+
@staticmethod
|
|
2161
|
+
@skip_validation()
|
|
2162
|
+
def _validate_http_response(http_response, valid_status_code, error_msg):
|
|
2163
|
+
"""
|
|
2164
|
+
DESCRIPTION:
|
|
2165
|
+
Internal function to validate the HTTP response.
|
|
2166
|
+
|
|
2167
|
+
PARAMETERS:
|
|
2168
|
+
http_response:
|
|
2169
|
+
Required Argument.
|
|
2170
|
+
Specifies the response object recieved from HTTP request.
|
|
2171
|
+
Types: requests.models.Response OR httpx.Response
|
|
2172
|
+
|
|
2173
|
+
valid_status_code:
|
|
2174
|
+
Required Argument.
|
|
2175
|
+
Specifies the HTTP response code of a request.
|
|
2176
|
+
Types: int
|
|
2177
|
+
|
|
2178
|
+
error_msg:
|
|
2179
|
+
Required Argument.
|
|
2180
|
+
Specifies the error message to be displayed when response code is
|
|
2181
|
+
not equal to "valid_status_code".
|
|
2182
|
+
Types: str
|
|
2183
|
+
|
|
2184
|
+
RETURNS:
|
|
2185
|
+
bool
|
|
2186
|
+
|
|
2187
|
+
RAISES:
|
|
2188
|
+
TeradatamlException
|
|
2189
|
+
|
|
2190
|
+
EXAMPLES:
|
|
2191
|
+
_Validators._validate_http_response(resp, 200, "test1")
|
|
2192
|
+
"""
|
|
2193
|
+
if http_response.status_code != valid_status_code:
|
|
2194
|
+
err_ = Messages.get_message(MessageCodes.EXECUTION_FAILED,
|
|
2195
|
+
error_msg,
|
|
2196
|
+
"Error-details: ({}){}".format(http_response.status_code, http_response.text))
|
|
2197
|
+
raise TeradataMlException(err_, MessageCodes.EXECUTION_FAILED)
|
|
2198
|
+
|
|
2199
|
+
return True
|
|
2200
|
+
|
|
2201
|
+
@staticmethod
|
|
2202
|
+
@skip_validation()
|
|
2203
|
+
def _validate_module_presence(module_name, function_name):
|
|
2204
|
+
"""
|
|
2205
|
+
DESCRIPTION:
|
|
2206
|
+
Check if module being imported is present.
|
|
2207
|
+
|
|
2208
|
+
PARAMETERS:
|
|
2209
|
+
module_name:
|
|
2210
|
+
Required Argument.
|
|
2211
|
+
Specifies the name of the module to import.
|
|
2212
|
+
Types: str
|
|
2213
|
+
|
|
2214
|
+
function_name:
|
|
2215
|
+
Required Argument.
|
|
2216
|
+
Specifies the name of the function from where module is imported.
|
|
2217
|
+
Types: str
|
|
2218
|
+
|
|
2219
|
+
RETURNS:
|
|
2220
|
+
None.
|
|
2221
|
+
|
|
2222
|
+
RAISES:
|
|
2223
|
+
TeradataMlException
|
|
2224
|
+
|
|
2225
|
+
EXAMPLES:
|
|
2226
|
+
_Validators._validate_module_presence("docker", "setup_sandbox_env")
|
|
2227
|
+
"""
|
|
2228
|
+
import importlib
|
|
2229
|
+
|
|
2230
|
+
try:
|
|
2231
|
+
importlib.import_module(module_name, package=None)
|
|
2232
|
+
except Exception as err:
|
|
2233
|
+
message = \
|
|
2234
|
+
Messages.get_message(
|
|
2235
|
+
MessageCodes.IMPORT_PYTHON_PACKAGE,
|
|
2236
|
+
module_name, module_name, function_name)
|
|
2237
|
+
raise TeradataMlException(message,
|
|
2238
|
+
MessageCodes.IMPORT_PYTHON_PACKAGE)
|
|
2239
|
+
return True
|