teradataml 20.0.0.8__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.
- teradataml/LICENSE-3RD-PARTY.pdf +0 -0
- teradataml/LICENSE.pdf +0 -0
- teradataml/README.md +2762 -0
- teradataml/__init__.py +78 -0
- teradataml/_version.py +11 -0
- teradataml/analytics/Transformations.py +2996 -0
- teradataml/analytics/__init__.py +82 -0
- teradataml/analytics/analytic_function_executor.py +2416 -0
- teradataml/analytics/analytic_query_generator.py +1050 -0
- teradataml/analytics/byom/H2OPredict.py +514 -0
- teradataml/analytics/byom/PMMLPredict.py +437 -0
- teradataml/analytics/byom/__init__.py +16 -0
- teradataml/analytics/json_parser/__init__.py +133 -0
- teradataml/analytics/json_parser/analytic_functions_argument.py +1805 -0
- teradataml/analytics/json_parser/json_store.py +191 -0
- teradataml/analytics/json_parser/metadata.py +1666 -0
- teradataml/analytics/json_parser/utils.py +805 -0
- teradataml/analytics/meta_class.py +236 -0
- teradataml/analytics/sqle/DecisionTreePredict.py +456 -0
- teradataml/analytics/sqle/NaiveBayesPredict.py +420 -0
- teradataml/analytics/sqle/__init__.py +128 -0
- teradataml/analytics/sqle/json/decisiontreepredict_sqle.json +78 -0
- teradataml/analytics/sqle/json/naivebayespredict_sqle.json +62 -0
- teradataml/analytics/table_operator/__init__.py +11 -0
- teradataml/analytics/uaf/__init__.py +82 -0
- teradataml/analytics/utils.py +828 -0
- teradataml/analytics/valib.py +1617 -0
- teradataml/automl/__init__.py +5835 -0
- teradataml/automl/autodataprep/__init__.py +493 -0
- teradataml/automl/custom_json_utils.py +1625 -0
- teradataml/automl/data_preparation.py +1384 -0
- teradataml/automl/data_transformation.py +1254 -0
- teradataml/automl/feature_engineering.py +2273 -0
- teradataml/automl/feature_exploration.py +1873 -0
- teradataml/automl/model_evaluation.py +488 -0
- teradataml/automl/model_training.py +1407 -0
- teradataml/catalog/__init__.py +2 -0
- teradataml/catalog/byom.py +1759 -0
- teradataml/catalog/function_argument_mapper.py +859 -0
- teradataml/catalog/model_cataloging_utils.py +491 -0
- teradataml/clients/__init__.py +0 -0
- teradataml/clients/auth_client.py +137 -0
- teradataml/clients/keycloak_client.py +165 -0
- teradataml/clients/pkce_client.py +481 -0
- teradataml/common/__init__.py +1 -0
- teradataml/common/aed_utils.py +2078 -0
- teradataml/common/bulk_exposed_utils.py +113 -0
- teradataml/common/constants.py +1669 -0
- teradataml/common/deprecations.py +166 -0
- teradataml/common/exceptions.py +147 -0
- teradataml/common/formula.py +743 -0
- teradataml/common/garbagecollector.py +666 -0
- teradataml/common/logger.py +1261 -0
- teradataml/common/messagecodes.py +518 -0
- teradataml/common/messages.py +262 -0
- teradataml/common/pylogger.py +67 -0
- teradataml/common/sqlbundle.py +764 -0
- teradataml/common/td_coltype_code_to_tdtype.py +48 -0
- teradataml/common/utils.py +3166 -0
- teradataml/common/warnings.py +36 -0
- teradataml/common/wrapper_utils.py +625 -0
- teradataml/config/__init__.py +0 -0
- teradataml/config/dummy_file1.cfg +5 -0
- teradataml/config/dummy_file2.cfg +3 -0
- teradataml/config/sqlengine_alias_definitions_v1.0 +14 -0
- teradataml/config/sqlengine_alias_definitions_v1.1 +20 -0
- teradataml/config/sqlengine_alias_definitions_v1.3 +19 -0
- teradataml/context/__init__.py +0 -0
- teradataml/context/aed_context.py +223 -0
- teradataml/context/context.py +1462 -0
- teradataml/data/A_loan.csv +19 -0
- teradataml/data/BINARY_REALS_LEFT.csv +11 -0
- teradataml/data/BINARY_REALS_RIGHT.csv +11 -0
- teradataml/data/B_loan.csv +49 -0
- teradataml/data/BuoyData2.csv +17 -0
- teradataml/data/CONVOLVE2_COMPLEX_LEFT.csv +5 -0
- teradataml/data/CONVOLVE2_COMPLEX_RIGHT.csv +5 -0
- teradataml/data/Convolve2RealsLeft.csv +5 -0
- teradataml/data/Convolve2RealsRight.csv +5 -0
- teradataml/data/Convolve2ValidLeft.csv +11 -0
- teradataml/data/Convolve2ValidRight.csv +11 -0
- teradataml/data/DFFTConv_Real_8_8.csv +65 -0
- teradataml/data/Employee.csv +5 -0
- teradataml/data/Employee_Address.csv +4 -0
- teradataml/data/Employee_roles.csv +5 -0
- teradataml/data/JulesBelvezeDummyData.csv +100 -0
- teradataml/data/Mall_customer_data.csv +201 -0
- teradataml/data/Orders1_12mf.csv +25 -0
- teradataml/data/Pi_loan.csv +7 -0
- teradataml/data/SMOOTHED_DATA.csv +7 -0
- teradataml/data/TestDFFT8.csv +9 -0
- teradataml/data/TestRiver.csv +109 -0
- teradataml/data/Traindata.csv +28 -0
- teradataml/data/__init__.py +0 -0
- teradataml/data/acf.csv +17 -0
- teradataml/data/adaboost_example.json +34 -0
- teradataml/data/adaboostpredict_example.json +24 -0
- teradataml/data/additional_table.csv +11 -0
- teradataml/data/admissions_test.csv +21 -0
- teradataml/data/admissions_train.csv +41 -0
- teradataml/data/admissions_train_nulls.csv +41 -0
- teradataml/data/advertising.csv +201 -0
- teradataml/data/ageandheight.csv +13 -0
- teradataml/data/ageandpressure.csv +31 -0
- teradataml/data/amazon_reviews_25.csv +26 -0
- teradataml/data/antiselect_example.json +36 -0
- teradataml/data/antiselect_input.csv +8 -0
- teradataml/data/antiselect_input_mixed_case.csv +8 -0
- teradataml/data/applicant_external.csv +7 -0
- teradataml/data/applicant_reference.csv +7 -0
- teradataml/data/apriori_example.json +22 -0
- teradataml/data/arima_example.json +9 -0
- teradataml/data/assortedtext_input.csv +8 -0
- teradataml/data/attribution_example.json +34 -0
- teradataml/data/attribution_sample_table.csv +27 -0
- teradataml/data/attribution_sample_table1.csv +6 -0
- teradataml/data/attribution_sample_table2.csv +11 -0
- teradataml/data/bank_churn.csv +10001 -0
- teradataml/data/bank_marketing.csv +11163 -0
- teradataml/data/bank_web_clicks1.csv +43 -0
- teradataml/data/bank_web_clicks2.csv +91 -0
- teradataml/data/bank_web_url.csv +85 -0
- teradataml/data/barrier.csv +2 -0
- teradataml/data/barrier_new.csv +3 -0
- teradataml/data/betweenness_example.json +14 -0
- teradataml/data/bike_sharing.csv +732 -0
- teradataml/data/bin_breaks.csv +8 -0
- teradataml/data/bin_fit_ip.csv +4 -0
- teradataml/data/binary_complex_left.csv +11 -0
- teradataml/data/binary_complex_right.csv +11 -0
- teradataml/data/binary_matrix_complex_left.csv +21 -0
- teradataml/data/binary_matrix_complex_right.csv +21 -0
- teradataml/data/binary_matrix_real_left.csv +21 -0
- teradataml/data/binary_matrix_real_right.csv +21 -0
- teradataml/data/blood2ageandweight.csv +26 -0
- teradataml/data/bmi.csv +501 -0
- teradataml/data/boston.csv +507 -0
- teradataml/data/boston2cols.csv +721 -0
- teradataml/data/breast_cancer.csv +570 -0
- teradataml/data/buoydata_mix.csv +11 -0
- teradataml/data/burst_data.csv +5 -0
- teradataml/data/burst_example.json +21 -0
- teradataml/data/byom_example.json +34 -0
- teradataml/data/bytes_table.csv +4 -0
- teradataml/data/cal_housing_ex_raw.csv +70 -0
- teradataml/data/callers.csv +7 -0
- teradataml/data/calls.csv +10 -0
- teradataml/data/cars_hist.csv +33 -0
- teradataml/data/cat_table.csv +25 -0
- teradataml/data/ccm_example.json +32 -0
- teradataml/data/ccm_input.csv +91 -0
- teradataml/data/ccm_input2.csv +13 -0
- teradataml/data/ccmexample.csv +101 -0
- teradataml/data/ccmprepare_example.json +9 -0
- teradataml/data/ccmprepare_input.csv +91 -0
- teradataml/data/cfilter_example.json +12 -0
- teradataml/data/changepointdetection_example.json +18 -0
- teradataml/data/changepointdetectionrt_example.json +8 -0
- teradataml/data/chi_sq.csv +3 -0
- teradataml/data/churn_data.csv +14 -0
- teradataml/data/churn_emission.csv +35 -0
- teradataml/data/churn_initial.csv +3 -0
- teradataml/data/churn_state_transition.csv +5 -0
- teradataml/data/citedges_2.csv +745 -0
- teradataml/data/citvertices_2.csv +1210 -0
- teradataml/data/clicks2.csv +16 -0
- teradataml/data/clickstream.csv +13 -0
- teradataml/data/clickstream1.csv +11 -0
- teradataml/data/closeness_example.json +16 -0
- teradataml/data/complaints.csv +21 -0
- teradataml/data/complaints_mini.csv +3 -0
- teradataml/data/complaints_test_tokenized.csv +353 -0
- teradataml/data/complaints_testtoken.csv +224 -0
- teradataml/data/complaints_tokens_model.csv +348 -0
- teradataml/data/complaints_tokens_test.csv +353 -0
- teradataml/data/complaints_traintoken.csv +472 -0
- teradataml/data/computers_category.csv +1001 -0
- teradataml/data/computers_test1.csv +1252 -0
- teradataml/data/computers_train1.csv +5009 -0
- teradataml/data/computers_train1_clustered.csv +5009 -0
- teradataml/data/confusionmatrix_example.json +9 -0
- teradataml/data/conversion_event_table.csv +3 -0
- teradataml/data/corr_input.csv +17 -0
- teradataml/data/correlation_example.json +11 -0
- teradataml/data/covid_confirm_sd.csv +83 -0
- teradataml/data/coxhazardratio_example.json +39 -0
- teradataml/data/coxph_example.json +15 -0
- teradataml/data/coxsurvival_example.json +28 -0
- teradataml/data/cpt.csv +41 -0
- teradataml/data/credit_ex_merged.csv +45 -0
- teradataml/data/creditcard_data.csv +1001 -0
- teradataml/data/customer_loyalty.csv +301 -0
- teradataml/data/customer_loyalty_newseq.csv +31 -0
- teradataml/data/customer_segmentation_test.csv +2628 -0
- teradataml/data/customer_segmentation_train.csv +8069 -0
- teradataml/data/dataframe_example.json +173 -0
- teradataml/data/decisionforest_example.json +37 -0
- teradataml/data/decisionforestpredict_example.json +38 -0
- teradataml/data/decisiontree_example.json +21 -0
- teradataml/data/decisiontreepredict_example.json +45 -0
- teradataml/data/dfft2_size4_real.csv +17 -0
- teradataml/data/dfft2_test_matrix16.csv +17 -0
- teradataml/data/dfft2conv_real_4_4.csv +65 -0
- teradataml/data/diabetes.csv +443 -0
- teradataml/data/diabetes_test.csv +89 -0
- teradataml/data/dict_table.csv +5 -0
- teradataml/data/docperterm_table.csv +4 -0
- teradataml/data/docs/__init__.py +1 -0
- teradataml/data/docs/byom/__init__.py +0 -0
- teradataml/data/docs/byom/docs/DataRobotPredict.py +180 -0
- teradataml/data/docs/byom/docs/DataikuPredict.py +217 -0
- teradataml/data/docs/byom/docs/H2OPredict.py +325 -0
- teradataml/data/docs/byom/docs/ONNXEmbeddings.py +242 -0
- teradataml/data/docs/byom/docs/ONNXPredict.py +283 -0
- teradataml/data/docs/byom/docs/ONNXSeq2Seq.py +255 -0
- teradataml/data/docs/byom/docs/PMMLPredict.py +278 -0
- teradataml/data/docs/byom/docs/__init__.py +0 -0
- teradataml/data/docs/sqle/__init__.py +0 -0
- teradataml/data/docs/sqle/docs_17_10/Antiselect.py +83 -0
- teradataml/data/docs/sqle/docs_17_10/Attribution.py +200 -0
- teradataml/data/docs/sqle/docs_17_10/BincodeFit.py +172 -0
- teradataml/data/docs/sqle/docs_17_10/BincodeTransform.py +131 -0
- teradataml/data/docs/sqle/docs_17_10/CategoricalSummary.py +86 -0
- teradataml/data/docs/sqle/docs_17_10/ChiSq.py +90 -0
- teradataml/data/docs/sqle/docs_17_10/ColumnSummary.py +86 -0
- teradataml/data/docs/sqle/docs_17_10/ConvertTo.py +96 -0
- teradataml/data/docs/sqle/docs_17_10/DecisionForestPredict.py +139 -0
- teradataml/data/docs/sqle/docs_17_10/DecisionTreePredict.py +152 -0
- teradataml/data/docs/sqle/docs_17_10/FTest.py +161 -0
- teradataml/data/docs/sqle/docs_17_10/FillRowId.py +83 -0
- teradataml/data/docs/sqle/docs_17_10/Fit.py +88 -0
- teradataml/data/docs/sqle/docs_17_10/GLMPredict.py +144 -0
- teradataml/data/docs/sqle/docs_17_10/GetRowsWithMissingValues.py +85 -0
- teradataml/data/docs/sqle/docs_17_10/GetRowsWithoutMissingValues.py +82 -0
- teradataml/data/docs/sqle/docs_17_10/Histogram.py +165 -0
- teradataml/data/docs/sqle/docs_17_10/MovingAverage.py +134 -0
- teradataml/data/docs/sqle/docs_17_10/NGramSplitter.py +209 -0
- teradataml/data/docs/sqle/docs_17_10/NPath.py +266 -0
- teradataml/data/docs/sqle/docs_17_10/NaiveBayesPredict.py +116 -0
- teradataml/data/docs/sqle/docs_17_10/NaiveBayesTextClassifierPredict.py +176 -0
- teradataml/data/docs/sqle/docs_17_10/NumApply.py +147 -0
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingFit.py +135 -0
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingTransform.py +109 -0
- teradataml/data/docs/sqle/docs_17_10/OutlierFilterFit.py +166 -0
- teradataml/data/docs/sqle/docs_17_10/OutlierFilterTransform.py +105 -0
- teradataml/data/docs/sqle/docs_17_10/Pack.py +128 -0
- teradataml/data/docs/sqle/docs_17_10/PolynomialFeaturesFit.py +112 -0
- teradataml/data/docs/sqle/docs_17_10/PolynomialFeaturesTransform.py +102 -0
- teradataml/data/docs/sqle/docs_17_10/QQNorm.py +105 -0
- teradataml/data/docs/sqle/docs_17_10/RoundColumns.py +110 -0
- teradataml/data/docs/sqle/docs_17_10/RowNormalizeFit.py +118 -0
- teradataml/data/docs/sqle/docs_17_10/RowNormalizeTransform.py +99 -0
- teradataml/data/docs/sqle/docs_17_10/SVMSparsePredict.py +153 -0
- teradataml/data/docs/sqle/docs_17_10/ScaleFit.py +197 -0
- teradataml/data/docs/sqle/docs_17_10/ScaleTransform.py +99 -0
- teradataml/data/docs/sqle/docs_17_10/Sessionize.py +114 -0
- teradataml/data/docs/sqle/docs_17_10/SimpleImputeFit.py +116 -0
- teradataml/data/docs/sqle/docs_17_10/SimpleImputeTransform.py +98 -0
- teradataml/data/docs/sqle/docs_17_10/StrApply.py +187 -0
- teradataml/data/docs/sqle/docs_17_10/StringSimilarity.py +146 -0
- teradataml/data/docs/sqle/docs_17_10/Transform.py +105 -0
- teradataml/data/docs/sqle/docs_17_10/UnivariateStatistics.py +142 -0
- teradataml/data/docs/sqle/docs_17_10/Unpack.py +214 -0
- teradataml/data/docs/sqle/docs_17_10/WhichMax.py +83 -0
- teradataml/data/docs/sqle/docs_17_10/WhichMin.py +83 -0
- teradataml/data/docs/sqle/docs_17_10/ZTest.py +155 -0
- teradataml/data/docs/sqle/docs_17_10/__init__.py +0 -0
- teradataml/data/docs/sqle/docs_17_20/ANOVA.py +186 -0
- teradataml/data/docs/sqle/docs_17_20/Antiselect.py +83 -0
- teradataml/data/docs/sqle/docs_17_20/Apriori.py +138 -0
- teradataml/data/docs/sqle/docs_17_20/Attribution.py +201 -0
- teradataml/data/docs/sqle/docs_17_20/BincodeFit.py +172 -0
- teradataml/data/docs/sqle/docs_17_20/BincodeTransform.py +139 -0
- teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
- teradataml/data/docs/sqle/docs_17_20/CategoricalSummary.py +86 -0
- teradataml/data/docs/sqle/docs_17_20/ChiSq.py +90 -0
- teradataml/data/docs/sqle/docs_17_20/ClassificationEvaluator.py +166 -0
- teradataml/data/docs/sqle/docs_17_20/ColumnSummary.py +86 -0
- teradataml/data/docs/sqle/docs_17_20/ColumnTransformer.py +246 -0
- teradataml/data/docs/sqle/docs_17_20/ConvertTo.py +113 -0
- teradataml/data/docs/sqle/docs_17_20/DecisionForest.py +280 -0
- teradataml/data/docs/sqle/docs_17_20/DecisionForestPredict.py +144 -0
- teradataml/data/docs/sqle/docs_17_20/DecisionTreePredict.py +136 -0
- teradataml/data/docs/sqle/docs_17_20/FTest.py +240 -0
- teradataml/data/docs/sqle/docs_17_20/FillRowId.py +83 -0
- teradataml/data/docs/sqle/docs_17_20/Fit.py +88 -0
- teradataml/data/docs/sqle/docs_17_20/GLM.py +541 -0
- teradataml/data/docs/sqle/docs_17_20/GLMPerSegment.py +415 -0
- teradataml/data/docs/sqle/docs_17_20/GLMPredict.py +144 -0
- teradataml/data/docs/sqle/docs_17_20/GLMPredictPerSegment.py +233 -0
- teradataml/data/docs/sqle/docs_17_20/GetFutileColumns.py +125 -0
- teradataml/data/docs/sqle/docs_17_20/GetRowsWithMissingValues.py +109 -0
- teradataml/data/docs/sqle/docs_17_20/GetRowsWithoutMissingValues.py +106 -0
- teradataml/data/docs/sqle/docs_17_20/Histogram.py +224 -0
- teradataml/data/docs/sqle/docs_17_20/KMeans.py +251 -0
- teradataml/data/docs/sqle/docs_17_20/KMeansPredict.py +144 -0
- teradataml/data/docs/sqle/docs_17_20/KNN.py +215 -0
- teradataml/data/docs/sqle/docs_17_20/MovingAverage.py +134 -0
- teradataml/data/docs/sqle/docs_17_20/NERExtractor.py +121 -0
- teradataml/data/docs/sqle/docs_17_20/NGramSplitter.py +209 -0
- teradataml/data/docs/sqle/docs_17_20/NPath.py +266 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesPredict.py +116 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierPredict.py +177 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierTrainer.py +127 -0
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineFit.py +119 -0
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineTransform.py +112 -0
- teradataml/data/docs/sqle/docs_17_20/NumApply.py +147 -0
- teradataml/data/docs/sqle/docs_17_20/OneClassSVM.py +307 -0
- teradataml/data/docs/sqle/docs_17_20/OneClassSVMPredict.py +185 -0
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingFit.py +231 -0
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingTransform.py +121 -0
- teradataml/data/docs/sqle/docs_17_20/OrdinalEncodingFit.py +220 -0
- teradataml/data/docs/sqle/docs_17_20/OrdinalEncodingTransform.py +127 -0
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +191 -0
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterTransform.py +117 -0
- teradataml/data/docs/sqle/docs_17_20/Pack.py +128 -0
- teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
- teradataml/data/docs/sqle/docs_17_20/PolynomialFeaturesFit.py +112 -0
- teradataml/data/docs/sqle/docs_17_20/PolynomialFeaturesTransform.py +112 -0
- teradataml/data/docs/sqle/docs_17_20/QQNorm.py +105 -0
- teradataml/data/docs/sqle/docs_17_20/ROC.py +164 -0
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionFit.py +155 -0
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionMinComponents.py +106 -0
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionTransform.py +120 -0
- teradataml/data/docs/sqle/docs_17_20/RegressionEvaluator.py +211 -0
- teradataml/data/docs/sqle/docs_17_20/RoundColumns.py +109 -0
- teradataml/data/docs/sqle/docs_17_20/RowNormalizeFit.py +118 -0
- teradataml/data/docs/sqle/docs_17_20/RowNormalizeTransform.py +111 -0
- teradataml/data/docs/sqle/docs_17_20/SMOTE.py +212 -0
- teradataml/data/docs/sqle/docs_17_20/SVM.py +414 -0
- teradataml/data/docs/sqle/docs_17_20/SVMPredict.py +213 -0
- teradataml/data/docs/sqle/docs_17_20/SVMSparsePredict.py +153 -0
- teradataml/data/docs/sqle/docs_17_20/ScaleFit.py +315 -0
- teradataml/data/docs/sqle/docs_17_20/ScaleTransform.py +202 -0
- teradataml/data/docs/sqle/docs_17_20/SentimentExtractor.py +206 -0
- teradataml/data/docs/sqle/docs_17_20/Sessionize.py +114 -0
- teradataml/data/docs/sqle/docs_17_20/Shap.py +225 -0
- teradataml/data/docs/sqle/docs_17_20/Silhouette.py +153 -0
- teradataml/data/docs/sqle/docs_17_20/SimpleImputeFit.py +116 -0
- teradataml/data/docs/sqle/docs_17_20/SimpleImputeTransform.py +109 -0
- teradataml/data/docs/sqle/docs_17_20/StrApply.py +187 -0
- teradataml/data/docs/sqle/docs_17_20/StringSimilarity.py +146 -0
- teradataml/data/docs/sqle/docs_17_20/TDDecisionForestPredict.py +207 -0
- teradataml/data/docs/sqle/docs_17_20/TDGLMPredict.py +333 -0
- teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
- teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
- teradataml/data/docs/sqle/docs_17_20/TargetEncodingFit.py +267 -0
- teradataml/data/docs/sqle/docs_17_20/TargetEncodingTransform.py +141 -0
- teradataml/data/docs/sqle/docs_17_20/TextMorph.py +119 -0
- teradataml/data/docs/sqle/docs_17_20/TextParser.py +224 -0
- teradataml/data/docs/sqle/docs_17_20/TrainTestSplit.py +160 -0
- teradataml/data/docs/sqle/docs_17_20/Transform.py +123 -0
- teradataml/data/docs/sqle/docs_17_20/UnivariateStatistics.py +142 -0
- teradataml/data/docs/sqle/docs_17_20/Unpack.py +214 -0
- teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
- teradataml/data/docs/sqle/docs_17_20/VectorDistance.py +169 -0
- teradataml/data/docs/sqle/docs_17_20/WhichMax.py +83 -0
- teradataml/data/docs/sqle/docs_17_20/WhichMin.py +83 -0
- teradataml/data/docs/sqle/docs_17_20/WordEmbeddings.py +237 -0
- teradataml/data/docs/sqle/docs_17_20/XGBoost.py +362 -0
- teradataml/data/docs/sqle/docs_17_20/XGBoostPredict.py +281 -0
- teradataml/data/docs/sqle/docs_17_20/ZTest.py +220 -0
- teradataml/data/docs/sqle/docs_17_20/__init__.py +0 -0
- teradataml/data/docs/tableoperator/__init__.py +0 -0
- teradataml/data/docs/tableoperator/docs_17_00/ReadNOS.py +430 -0
- teradataml/data/docs/tableoperator/docs_17_00/__init__.py +0 -0
- teradataml/data/docs/tableoperator/docs_17_05/ReadNOS.py +430 -0
- teradataml/data/docs/tableoperator/docs_17_05/WriteNOS.py +348 -0
- teradataml/data/docs/tableoperator/docs_17_05/__init__.py +0 -0
- teradataml/data/docs/tableoperator/docs_17_10/ReadNOS.py +429 -0
- teradataml/data/docs/tableoperator/docs_17_10/WriteNOS.py +348 -0
- teradataml/data/docs/tableoperator/docs_17_10/__init__.py +0 -0
- teradataml/data/docs/tableoperator/docs_17_20/Image2Matrix.py +118 -0
- teradataml/data/docs/tableoperator/docs_17_20/ReadNOS.py +440 -0
- teradataml/data/docs/tableoperator/docs_17_20/WriteNOS.py +387 -0
- teradataml/data/docs/tableoperator/docs_17_20/__init__.py +0 -0
- teradataml/data/docs/uaf/__init__.py +0 -0
- teradataml/data/docs/uaf/docs_17_20/ACF.py +186 -0
- teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +370 -0
- teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +172 -0
- teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +161 -0
- teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
- teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
- teradataml/data/docs/uaf/docs_17_20/BinaryMatrixOp.py +248 -0
- teradataml/data/docs/uaf/docs_17_20/BinarySeriesOp.py +252 -0
- teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +178 -0
- teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +175 -0
- teradataml/data/docs/uaf/docs_17_20/Convolve.py +230 -0
- teradataml/data/docs/uaf/docs_17_20/Convolve2.py +218 -0
- teradataml/data/docs/uaf/docs_17_20/CopyArt.py +145 -0
- teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +185 -0
- teradataml/data/docs/uaf/docs_17_20/DFFT.py +204 -0
- teradataml/data/docs/uaf/docs_17_20/DFFT2.py +216 -0
- teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +216 -0
- teradataml/data/docs/uaf/docs_17_20/DFFTConv.py +192 -0
- teradataml/data/docs/uaf/docs_17_20/DIFF.py +175 -0
- teradataml/data/docs/uaf/docs_17_20/DTW.py +180 -0
- teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
- teradataml/data/docs/uaf/docs_17_20/DWT2D.py +217 -0
- teradataml/data/docs/uaf/docs_17_20/DickeyFuller.py +142 -0
- teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +184 -0
- teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +185 -0
- teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
- teradataml/data/docs/uaf/docs_17_20/FitMetrics.py +172 -0
- teradataml/data/docs/uaf/docs_17_20/GenseriesFormula.py +206 -0
- teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +143 -0
- teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +198 -0
- teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +260 -0
- teradataml/data/docs/uaf/docs_17_20/IDFFT.py +165 -0
- teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +191 -0
- teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
- teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
- teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
- teradataml/data/docs/uaf/docs_17_20/InputValidator.py +121 -0
- teradataml/data/docs/uaf/docs_17_20/LineSpec.py +156 -0
- teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +215 -0
- teradataml/data/docs/uaf/docs_17_20/MAMean.py +174 -0
- teradataml/data/docs/uaf/docs_17_20/MInfo.py +134 -0
- teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
- teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +145 -0
- teradataml/data/docs/uaf/docs_17_20/MultivarRegr.py +191 -0
- teradataml/data/docs/uaf/docs_17_20/PACF.py +157 -0
- teradataml/data/docs/uaf/docs_17_20/Portman.py +217 -0
- teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +203 -0
- teradataml/data/docs/uaf/docs_17_20/PowerTransform.py +155 -0
- teradataml/data/docs/uaf/docs_17_20/Resample.py +237 -0
- teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
- teradataml/data/docs/uaf/docs_17_20/SInfo.py +123 -0
- teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +173 -0
- teradataml/data/docs/uaf/docs_17_20/SelectionCriteria.py +174 -0
- teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +171 -0
- teradataml/data/docs/uaf/docs_17_20/SignifResidmean.py +164 -0
- teradataml/data/docs/uaf/docs_17_20/SimpleExp.py +180 -0
- teradataml/data/docs/uaf/docs_17_20/Smoothma.py +208 -0
- teradataml/data/docs/uaf/docs_17_20/TrackingOp.py +151 -0
- teradataml/data/docs/uaf/docs_17_20/UNDIFF.py +171 -0
- teradataml/data/docs/uaf/docs_17_20/Unnormalize.py +202 -0
- teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +171 -0
- teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
- teradataml/data/docs/uaf/docs_17_20/__init__.py +0 -0
- teradataml/data/dtw_example.json +18 -0
- teradataml/data/dtw_t1.csv +11 -0
- teradataml/data/dtw_t2.csv +4 -0
- teradataml/data/dwt2d_dataTable.csv +65 -0
- teradataml/data/dwt2d_example.json +16 -0
- teradataml/data/dwt_dataTable.csv +8 -0
- teradataml/data/dwt_example.json +15 -0
- teradataml/data/dwt_filterTable.csv +3 -0
- teradataml/data/dwt_filter_dim.csv +5 -0
- teradataml/data/emission.csv +9 -0
- teradataml/data/emp_table_by_dept.csv +19 -0
- teradataml/data/employee_info.csv +4 -0
- teradataml/data/employee_table.csv +6 -0
- teradataml/data/excluding_event_table.csv +2 -0
- teradataml/data/finance_data.csv +6 -0
- teradataml/data/finance_data2.csv +61 -0
- teradataml/data/finance_data3.csv +93 -0
- teradataml/data/finance_data4.csv +13 -0
- teradataml/data/fish.csv +160 -0
- teradataml/data/fm_blood2ageandweight.csv +26 -0
- teradataml/data/fmeasure_example.json +12 -0
- teradataml/data/followers_leaders.csv +10 -0
- teradataml/data/fpgrowth_example.json +12 -0
- teradataml/data/frequentpaths_example.json +29 -0
- teradataml/data/friends.csv +9 -0
- teradataml/data/fs_input.csv +33 -0
- teradataml/data/fs_input1.csv +33 -0
- teradataml/data/genData.csv +513 -0
- teradataml/data/geodataframe_example.json +40 -0
- teradataml/data/glass_types.csv +215 -0
- teradataml/data/glm_admissions_model.csv +12 -0
- teradataml/data/glm_example.json +56 -0
- teradataml/data/glml1l2_example.json +28 -0
- teradataml/data/glml1l2predict_example.json +54 -0
- teradataml/data/glmpredict_example.json +54 -0
- teradataml/data/gq_t1.csv +21 -0
- teradataml/data/grocery_transaction.csv +19 -0
- teradataml/data/hconvolve_complex_right.csv +5 -0
- teradataml/data/hconvolve_complex_rightmulti.csv +5 -0
- teradataml/data/histogram_example.json +12 -0
- teradataml/data/hmmdecoder_example.json +79 -0
- teradataml/data/hmmevaluator_example.json +25 -0
- teradataml/data/hmmsupervised_example.json +10 -0
- teradataml/data/hmmunsupervised_example.json +8 -0
- teradataml/data/hnsw_alter_data.csv +5 -0
- teradataml/data/hnsw_data.csv +10 -0
- teradataml/data/house_values.csv +12 -0
- teradataml/data/house_values2.csv +13 -0
- teradataml/data/housing_cat.csv +7 -0
- teradataml/data/housing_data.csv +9 -0
- teradataml/data/housing_test.csv +47 -0
- teradataml/data/housing_test_binary.csv +47 -0
- teradataml/data/housing_train.csv +493 -0
- teradataml/data/housing_train_attribute.csv +5 -0
- teradataml/data/housing_train_binary.csv +437 -0
- teradataml/data/housing_train_parameter.csv +2 -0
- teradataml/data/housing_train_response.csv +493 -0
- teradataml/data/housing_train_segment.csv +201 -0
- teradataml/data/ibm_stock.csv +370 -0
- teradataml/data/ibm_stock1.csv +370 -0
- teradataml/data/identitymatch_example.json +22 -0
- teradataml/data/idf_table.csv +4 -0
- teradataml/data/idwt2d_dataTable.csv +5 -0
- teradataml/data/idwt_dataTable.csv +8 -0
- teradataml/data/idwt_filterTable.csv +3 -0
- teradataml/data/impressions.csv +101 -0
- teradataml/data/inflation.csv +21 -0
- teradataml/data/initial.csv +3 -0
- teradataml/data/insect2Cols.csv +61 -0
- teradataml/data/insect_sprays.csv +13 -0
- teradataml/data/insurance.csv +1339 -0
- teradataml/data/interpolator_example.json +13 -0
- teradataml/data/interval_data.csv +5 -0
- teradataml/data/iris_altinput.csv +481 -0
- teradataml/data/iris_attribute_output.csv +8 -0
- teradataml/data/iris_attribute_test.csv +121 -0
- teradataml/data/iris_attribute_train.csv +481 -0
- teradataml/data/iris_category_expect_predict.csv +31 -0
- teradataml/data/iris_data.csv +151 -0
- teradataml/data/iris_input.csv +151 -0
- teradataml/data/iris_response_train.csv +121 -0
- teradataml/data/iris_test.csv +31 -0
- teradataml/data/iris_train.csv +121 -0
- teradataml/data/join_table1.csv +4 -0
- teradataml/data/join_table2.csv +4 -0
- teradataml/data/jsons/anly_function_name.json +7 -0
- teradataml/data/jsons/byom/ONNXSeq2Seq.json +287 -0
- teradataml/data/jsons/byom/dataikupredict.json +148 -0
- teradataml/data/jsons/byom/datarobotpredict.json +147 -0
- teradataml/data/jsons/byom/h2opredict.json +195 -0
- teradataml/data/jsons/byom/onnxembeddings.json +267 -0
- teradataml/data/jsons/byom/onnxpredict.json +187 -0
- teradataml/data/jsons/byom/pmmlpredict.json +147 -0
- teradataml/data/jsons/paired_functions.json +450 -0
- teradataml/data/jsons/sqle/16.20/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/16.20/Attribution.json +249 -0
- teradataml/data/jsons/sqle/16.20/DecisionForestPredict.json +156 -0
- teradataml/data/jsons/sqle/16.20/DecisionTreePredict.json +170 -0
- teradataml/data/jsons/sqle/16.20/GLMPredict.json +122 -0
- teradataml/data/jsons/sqle/16.20/MovingAverage.json +367 -0
- teradataml/data/jsons/sqle/16.20/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/16.20/NaiveBayesPredict.json +136 -0
- teradataml/data/jsons/sqle/16.20/NaiveBayesTextClassifierPredict.json +235 -0
- teradataml/data/jsons/sqle/16.20/Pack.json +98 -0
- teradataml/data/jsons/sqle/16.20/SVMSparsePredict.json +162 -0
- teradataml/data/jsons/sqle/16.20/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/16.20/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/16.20/Unpack.json +166 -0
- teradataml/data/jsons/sqle/16.20/nPath.json +269 -0
- teradataml/data/jsons/sqle/17.00/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/17.00/Attribution.json +249 -0
- teradataml/data/jsons/sqle/17.00/DecisionForestPredict.json +156 -0
- teradataml/data/jsons/sqle/17.00/DecisionTreePredict.json +170 -0
- teradataml/data/jsons/sqle/17.00/GLMPredict.json +122 -0
- teradataml/data/jsons/sqle/17.00/MovingAverage.json +367 -0
- teradataml/data/jsons/sqle/17.00/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/17.00/NaiveBayesPredict.json +136 -0
- teradataml/data/jsons/sqle/17.00/NaiveBayesTextClassifierPredict.json +235 -0
- teradataml/data/jsons/sqle/17.00/Pack.json +98 -0
- teradataml/data/jsons/sqle/17.00/SVMSparsePredict.json +162 -0
- teradataml/data/jsons/sqle/17.00/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/17.00/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/17.00/Unpack.json +166 -0
- teradataml/data/jsons/sqle/17.00/nPath.json +269 -0
- teradataml/data/jsons/sqle/17.05/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/17.05/Attribution.json +249 -0
- teradataml/data/jsons/sqle/17.05/DecisionForestPredict.json +156 -0
- teradataml/data/jsons/sqle/17.05/DecisionTreePredict.json +170 -0
- teradataml/data/jsons/sqle/17.05/GLMPredict.json +122 -0
- teradataml/data/jsons/sqle/17.05/MovingAverage.json +367 -0
- teradataml/data/jsons/sqle/17.05/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/17.05/NaiveBayesPredict.json +136 -0
- teradataml/data/jsons/sqle/17.05/NaiveBayesTextClassifierPredict.json +235 -0
- teradataml/data/jsons/sqle/17.05/Pack.json +98 -0
- teradataml/data/jsons/sqle/17.05/SVMSparsePredict.json +162 -0
- teradataml/data/jsons/sqle/17.05/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/17.05/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/17.05/Unpack.json +166 -0
- teradataml/data/jsons/sqle/17.05/nPath.json +269 -0
- teradataml/data/jsons/sqle/17.10/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/17.10/Attribution.json +249 -0
- teradataml/data/jsons/sqle/17.10/DecisionForestPredict.json +185 -0
- teradataml/data/jsons/sqle/17.10/DecisionTreePredict.json +172 -0
- teradataml/data/jsons/sqle/17.10/GLMPredict.json +151 -0
- teradataml/data/jsons/sqle/17.10/MovingAverage.json +368 -0
- teradataml/data/jsons/sqle/17.10/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/17.10/NaiveBayesPredict.json +149 -0
- teradataml/data/jsons/sqle/17.10/NaiveBayesTextClassifierPredict.json +288 -0
- teradataml/data/jsons/sqle/17.10/Pack.json +133 -0
- teradataml/data/jsons/sqle/17.10/SVMSparsePredict.json +193 -0
- teradataml/data/jsons/sqle/17.10/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/17.10/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/17.10/TD_BinCodeFit.json +239 -0
- teradataml/data/jsons/sqle/17.10/TD_BinCodeTransform.json +70 -0
- teradataml/data/jsons/sqle/17.10/TD_CategoricalSummary.json +54 -0
- teradataml/data/jsons/sqle/17.10/TD_Chisq.json +68 -0
- teradataml/data/jsons/sqle/17.10/TD_ColumnSummary.json +54 -0
- teradataml/data/jsons/sqle/17.10/TD_ConvertTo.json +69 -0
- teradataml/data/jsons/sqle/17.10/TD_FTest.json +187 -0
- teradataml/data/jsons/sqle/17.10/TD_FillRowID.json +52 -0
- teradataml/data/jsons/sqle/17.10/TD_FunctionFit.json +46 -0
- teradataml/data/jsons/sqle/17.10/TD_FunctionTransform.json +72 -0
- teradataml/data/jsons/sqle/17.10/TD_GetRowsWithMissingValues.json +53 -0
- teradataml/data/jsons/sqle/17.10/TD_GetRowsWithoutMissingValues.json +53 -0
- teradataml/data/jsons/sqle/17.10/TD_Histogram.json +133 -0
- teradataml/data/jsons/sqle/17.10/TD_NumApply.json +147 -0
- teradataml/data/jsons/sqle/17.10/TD_OneHotEncodingFit.json +183 -0
- teradataml/data/jsons/sqle/17.10/TD_OneHotEncodingTransform.json +66 -0
- teradataml/data/jsons/sqle/17.10/TD_OutlierFilterFit.json +197 -0
- teradataml/data/jsons/sqle/17.10/TD_OutlierFilterTransform.json +48 -0
- teradataml/data/jsons/sqle/17.10/TD_PolynomialFeaturesFit.json +114 -0
- teradataml/data/jsons/sqle/17.10/TD_PolynomialFeaturesTransform.json +72 -0
- teradataml/data/jsons/sqle/17.10/TD_QQNorm.json +112 -0
- teradataml/data/jsons/sqle/17.10/TD_RoundColumns.json +93 -0
- teradataml/data/jsons/sqle/17.10/TD_RowNormalizeFit.json +128 -0
- teradataml/data/jsons/sqle/17.10/TD_RowNormalizeTransform.json +71 -0
- teradataml/data/jsons/sqle/17.10/TD_ScaleFit.json +157 -0
- teradataml/data/jsons/sqle/17.10/TD_ScaleTransform.json +71 -0
- teradataml/data/jsons/sqle/17.10/TD_SimpleImputeFit.json +148 -0
- teradataml/data/jsons/sqle/17.10/TD_SimpleImputeTransform.json +48 -0
- teradataml/data/jsons/sqle/17.10/TD_StrApply.json +240 -0
- teradataml/data/jsons/sqle/17.10/TD_UnivariateStatistics.json +119 -0
- teradataml/data/jsons/sqle/17.10/TD_WhichMax.json +53 -0
- teradataml/data/jsons/sqle/17.10/TD_WhichMin.json +53 -0
- teradataml/data/jsons/sqle/17.10/TD_ZTest.json +171 -0
- teradataml/data/jsons/sqle/17.10/Unpack.json +188 -0
- teradataml/data/jsons/sqle/17.10/nPath.json +269 -0
- teradataml/data/jsons/sqle/17.20/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/17.20/Attribution.json +249 -0
- teradataml/data/jsons/sqle/17.20/DecisionForestPredict.json +185 -0
- teradataml/data/jsons/sqle/17.20/DecisionTreePredict.json +172 -0
- teradataml/data/jsons/sqle/17.20/GLMPredict.json +151 -0
- teradataml/data/jsons/sqle/17.20/MovingAverage.json +367 -0
- teradataml/data/jsons/sqle/17.20/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/17.20/NaiveBayesPredict.json +149 -0
- teradataml/data/jsons/sqle/17.20/NaiveBayesTextClassifierPredict.json +287 -0
- teradataml/data/jsons/sqle/17.20/Pack.json +133 -0
- teradataml/data/jsons/sqle/17.20/SVMSparsePredict.json +192 -0
- teradataml/data/jsons/sqle/17.20/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/17.20/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/17.20/TD_ANOVA.json +149 -0
- teradataml/data/jsons/sqle/17.20/TD_Apriori.json +181 -0
- teradataml/data/jsons/sqle/17.20/TD_BinCodeFit.json +239 -0
- teradataml/data/jsons/sqle/17.20/TD_BinCodeTransform.json +71 -0
- teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
- teradataml/data/jsons/sqle/17.20/TD_CategoricalSummary.json +53 -0
- teradataml/data/jsons/sqle/17.20/TD_Chisq.json +68 -0
- teradataml/data/jsons/sqle/17.20/TD_ClassificationEvaluator.json +146 -0
- teradataml/data/jsons/sqle/17.20/TD_ColumnSummary.json +53 -0
- teradataml/data/jsons/sqle/17.20/TD_ColumnTransformer.json +218 -0
- teradataml/data/jsons/sqle/17.20/TD_ConvertTo.json +92 -0
- teradataml/data/jsons/sqle/17.20/TD_DecisionForest.json +260 -0
- teradataml/data/jsons/sqle/17.20/TD_DecisionForestPredict.json +139 -0
- teradataml/data/jsons/sqle/17.20/TD_FTest.json +269 -0
- teradataml/data/jsons/sqle/17.20/TD_FillRowID.json +52 -0
- teradataml/data/jsons/sqle/17.20/TD_FunctionFit.json +46 -0
- teradataml/data/jsons/sqle/17.20/TD_FunctionTransform.json +72 -0
- teradataml/data/jsons/sqle/17.20/TD_GLM.json +507 -0
- teradataml/data/jsons/sqle/17.20/TD_GLMPREDICT.json +168 -0
- teradataml/data/jsons/sqle/17.20/TD_GLMPerSegment.json +411 -0
- teradataml/data/jsons/sqle/17.20/TD_GLMPredictPerSegment.json +146 -0
- teradataml/data/jsons/sqle/17.20/TD_GetFutileColumns.json +93 -0
- teradataml/data/jsons/sqle/17.20/TD_GetRowsWithMissingValues.json +76 -0
- teradataml/data/jsons/sqle/17.20/TD_GetRowsWithoutMissingValues.json +76 -0
- teradataml/data/jsons/sqle/17.20/TD_Histogram.json +152 -0
- teradataml/data/jsons/sqle/17.20/TD_KMeans.json +232 -0
- teradataml/data/jsons/sqle/17.20/TD_KMeansPredict.json +87 -0
- teradataml/data/jsons/sqle/17.20/TD_KNN.json +262 -0
- teradataml/data/jsons/sqle/17.20/TD_NERExtractor.json +145 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayesTextClassifierTrainer.json +137 -0
- teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineFit.json +102 -0
- teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineTransform.json +71 -0
- teradataml/data/jsons/sqle/17.20/TD_NumApply.json +147 -0
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +316 -0
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVMPredict.json +124 -0
- teradataml/data/jsons/sqle/17.20/TD_OneHotEncodingFit.json +271 -0
- teradataml/data/jsons/sqle/17.20/TD_OneHotEncodingTransform.json +65 -0
- teradataml/data/jsons/sqle/17.20/TD_OrdinalEncodingFit.json +229 -0
- teradataml/data/jsons/sqle/17.20/TD_OrdinalEncodingTransform.json +75 -0
- teradataml/data/jsons/sqle/17.20/TD_OutlierFilterFit.json +217 -0
- teradataml/data/jsons/sqle/17.20/TD_OutlierFilterTransform.json +48 -0
- teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
- teradataml/data/jsons/sqle/17.20/TD_PolynomialFeaturesFit.json +114 -0
- teradataml/data/jsons/sqle/17.20/TD_PolynomialFeaturesTransform.json +72 -0
- teradataml/data/jsons/sqle/17.20/TD_QQNorm.json +111 -0
- teradataml/data/jsons/sqle/17.20/TD_ROC.json +179 -0
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionFit.json +179 -0
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionMinComponents.json +74 -0
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionTransform.json +74 -0
- teradataml/data/jsons/sqle/17.20/TD_RegressionEvaluator.json +138 -0
- teradataml/data/jsons/sqle/17.20/TD_RoundColumns.json +93 -0
- teradataml/data/jsons/sqle/17.20/TD_RowNormalizeFit.json +128 -0
- teradataml/data/jsons/sqle/17.20/TD_RowNormalizeTransform.json +71 -0
- teradataml/data/jsons/sqle/17.20/TD_SMOTE.json +267 -0
- teradataml/data/jsons/sqle/17.20/TD_SVM.json +389 -0
- teradataml/data/jsons/sqle/17.20/TD_SVMPredict.json +142 -0
- teradataml/data/jsons/sqle/17.20/TD_ScaleFit.json +310 -0
- teradataml/data/jsons/sqle/17.20/TD_ScaleTransform.json +120 -0
- teradataml/data/jsons/sqle/17.20/TD_SentimentExtractor.json +194 -0
- teradataml/data/jsons/sqle/17.20/TD_Shap.json +221 -0
- teradataml/data/jsons/sqle/17.20/TD_Silhouette.json +143 -0
- teradataml/data/jsons/sqle/17.20/TD_SimpleImputeFit.json +147 -0
- teradataml/data/jsons/sqle/17.20/TD_SimpleImputeTransform.json +48 -0
- teradataml/data/jsons/sqle/17.20/TD_StrApply.json +240 -0
- teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
- teradataml/data/jsons/sqle/17.20/TD_TargetEncodingFit.json +248 -0
- teradataml/data/jsons/sqle/17.20/TD_TargetEncodingTransform.json +75 -0
- teradataml/data/jsons/sqle/17.20/TD_TextMorph.json +134 -0
- teradataml/data/jsons/sqle/17.20/TD_TextParser.json +297 -0
- teradataml/data/jsons/sqle/17.20/TD_TrainTestSplit.json +142 -0
- teradataml/data/jsons/sqle/17.20/TD_UnivariateStatistics.json +117 -0
- teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
- teradataml/data/jsons/sqle/17.20/TD_VectorDistance.json +183 -0
- teradataml/data/jsons/sqle/17.20/TD_WhichMax.json +53 -0
- teradataml/data/jsons/sqle/17.20/TD_WhichMin.json +53 -0
- teradataml/data/jsons/sqle/17.20/TD_WordEmbeddings.json +241 -0
- teradataml/data/jsons/sqle/17.20/TD_XGBoost.json +330 -0
- teradataml/data/jsons/sqle/17.20/TD_XGBoostPredict.json +195 -0
- teradataml/data/jsons/sqle/17.20/TD_ZTest.json +247 -0
- teradataml/data/jsons/sqle/17.20/Unpack.json +188 -0
- teradataml/data/jsons/sqle/17.20/nPath.json +269 -0
- teradataml/data/jsons/sqle/20.00/AI_AnalyzeSentiment.json +370 -0
- teradataml/data/jsons/sqle/20.00/AI_AskLLM.json +460 -0
- teradataml/data/jsons/sqle/20.00/AI_DetectLanguage.json +385 -0
- teradataml/data/jsons/sqle/20.00/AI_ExtractKeyPhrases.json +369 -0
- teradataml/data/jsons/sqle/20.00/AI_MaskPII.json +369 -0
- teradataml/data/jsons/sqle/20.00/AI_RecognizeEntities.json +369 -0
- teradataml/data/jsons/sqle/20.00/AI_RecognizePIIEntities.json +369 -0
- teradataml/data/jsons/sqle/20.00/AI_TextClassifier.json +400 -0
- teradataml/data/jsons/sqle/20.00/AI_TextEmbeddings.json +401 -0
- teradataml/data/jsons/sqle/20.00/AI_TextSummarize.json +384 -0
- teradataml/data/jsons/sqle/20.00/AI_TextTranslate.json +384 -0
- teradataml/data/jsons/sqle/20.00/TD_API_AzureML.json +151 -0
- teradataml/data/jsons/sqle/20.00/TD_API_Sagemaker.json +182 -0
- teradataml/data/jsons/sqle/20.00/TD_API_VertexAI.json +183 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSW.json +296 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSWPredict.json +206 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSWSummary.json +32 -0
- teradataml/data/jsons/sqle/20.00/TD_KMeans.json +250 -0
- teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +266 -0
- teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +278 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_COPYART.json +71 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
- teradataml/data/jsons/tableoperator/17.00/read_nos.json +198 -0
- teradataml/data/jsons/tableoperator/17.05/read_nos.json +198 -0
- teradataml/data/jsons/tableoperator/17.05/write_nos.json +195 -0
- teradataml/data/jsons/tableoperator/17.10/read_nos.json +184 -0
- teradataml/data/jsons/tableoperator/17.10/write_nos.json +195 -0
- teradataml/data/jsons/tableoperator/17.20/IMAGE2MATRIX.json +53 -0
- teradataml/data/jsons/tableoperator/17.20/read_nos.json +183 -0
- teradataml/data/jsons/tableoperator/17.20/write_nos.json +224 -0
- teradataml/data/jsons/uaf/17.20/TD_ACF.json +132 -0
- teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +396 -0
- teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +77 -0
- teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +153 -0
- teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
- teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
- teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +107 -0
- teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +106 -0
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +89 -0
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +104 -0
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +78 -0
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +66 -0
- teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +87 -0
- teradataml/data/jsons/uaf/17.20/TD_DFFT.json +134 -0
- teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +144 -0
- teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +108 -0
- teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +108 -0
- teradataml/data/jsons/uaf/17.20/TD_DICKEY_FULLER.json +78 -0
- teradataml/data/jsons/uaf/17.20/TD_DIFF.json +92 -0
- teradataml/data/jsons/uaf/17.20/TD_DTW.json +114 -0
- teradataml/data/jsons/uaf/17.20/TD_DURBIN_WATSON.json +101 -0
- teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
- teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
- teradataml/data/jsons/uaf/17.20/TD_EXTRACT_RESULTS.json +39 -0
- teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +101 -0
- teradataml/data/jsons/uaf/17.20/TD_GENSERIES4FORMULA.json +85 -0
- teradataml/data/jsons/uaf/17.20/TD_GENSERIES4SINUSOIDS.json +71 -0
- teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +139 -0
- teradataml/data/jsons/uaf/17.20/TD_HOLT_WINTERS_FORECASTER.json +313 -0
- teradataml/data/jsons/uaf/17.20/TD_IDFFT.json +58 -0
- teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +81 -0
- teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
- teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
- teradataml/data/jsons/uaf/17.20/TD_INPUTVALIDATOR.json +64 -0
- teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
- teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +182 -0
- teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +103 -0
- teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +181 -0
- teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
- teradataml/data/jsons/uaf/17.20/TD_MATRIXMULTIPLY.json +68 -0
- teradataml/data/jsons/uaf/17.20/TD_MINFO.json +67 -0
- teradataml/data/jsons/uaf/17.20/TD_MULTIVAR_REGR.json +179 -0
- teradataml/data/jsons/uaf/17.20/TD_PACF.json +114 -0
- teradataml/data/jsons/uaf/17.20/TD_PORTMAN.json +119 -0
- teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +175 -0
- teradataml/data/jsons/uaf/17.20/TD_POWERTRANSFORM.json +98 -0
- teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +194 -0
- teradataml/data/jsons/uaf/17.20/TD_SAX.json +210 -0
- teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +143 -0
- teradataml/data/jsons/uaf/17.20/TD_SELECTION_CRITERIA.json +90 -0
- teradataml/data/jsons/uaf/17.20/TD_SIGNIF_PERIODICITIES.json +80 -0
- teradataml/data/jsons/uaf/17.20/TD_SIGNIF_RESIDMEAN.json +68 -0
- teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +184 -0
- teradataml/data/jsons/uaf/17.20/TD_SINFO.json +58 -0
- teradataml/data/jsons/uaf/17.20/TD_SMOOTHMA.json +163 -0
- teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +101 -0
- teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +112 -0
- teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +95 -0
- teradataml/data/jsons/uaf/17.20/TD_WHITES_GENERAL.json +78 -0
- teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +410 -0
- teradataml/data/kmeans_example.json +23 -0
- teradataml/data/kmeans_table.csv +10 -0
- teradataml/data/kmeans_us_arrests_data.csv +51 -0
- teradataml/data/knn_example.json +19 -0
- teradataml/data/knnrecommender_example.json +7 -0
- teradataml/data/knnrecommenderpredict_example.json +12 -0
- teradataml/data/lar_example.json +17 -0
- teradataml/data/larpredict_example.json +30 -0
- teradataml/data/lc_new_predictors.csv +5 -0
- teradataml/data/lc_new_reference.csv +9 -0
- teradataml/data/lda_example.json +9 -0
- teradataml/data/ldainference_example.json +15 -0
- teradataml/data/ldatopicsummary_example.json +9 -0
- teradataml/data/levendist_input.csv +13 -0
- teradataml/data/levenshteindistance_example.json +10 -0
- teradataml/data/linreg_example.json +10 -0
- teradataml/data/load_example_data.py +350 -0
- teradataml/data/loan_prediction.csv +295 -0
- teradataml/data/lungcancer.csv +138 -0
- teradataml/data/mappingdata.csv +12 -0
- teradataml/data/medical_readings.csv +101 -0
- teradataml/data/milk_timeseries.csv +157 -0
- teradataml/data/min_max_titanic.csv +4 -0
- teradataml/data/minhash_example.json +6 -0
- teradataml/data/ml_ratings.csv +7547 -0
- teradataml/data/ml_ratings_10.csv +2445 -0
- teradataml/data/mobile_data.csv +13 -0
- teradataml/data/model1_table.csv +5 -0
- teradataml/data/model2_table.csv +5 -0
- teradataml/data/models/License_file.txt +1 -0
- teradataml/data/models/License_file_empty.txt +0 -0
- teradataml/data/models/dataiku_iris_data_ann_thin +0 -0
- teradataml/data/models/dr_iris_rf +0 -0
- teradataml/data/models/iris_db_dt_model_sklearn.onnx +0 -0
- teradataml/data/models/iris_db_dt_model_sklearn_floattensor.onnx +0 -0
- teradataml/data/models/iris_db_glm_model.pmml +57 -0
- teradataml/data/models/iris_db_xgb_model.pmml +4471 -0
- teradataml/data/models/iris_kmeans_model +0 -0
- teradataml/data/models/iris_mojo_glm_h2o_model +0 -0
- teradataml/data/models/iris_mojo_xgb_h2o_model +0 -0
- teradataml/data/modularity_example.json +12 -0
- teradataml/data/movavg_example.json +8 -0
- teradataml/data/mtx1.csv +7 -0
- teradataml/data/mtx2.csv +13 -0
- teradataml/data/multi_model_classification.csv +401 -0
- teradataml/data/multi_model_regression.csv +401 -0
- teradataml/data/mvdfft8.csv +9 -0
- teradataml/data/naivebayes_example.json +10 -0
- teradataml/data/naivebayespredict_example.json +19 -0
- teradataml/data/naivebayestextclassifier2_example.json +7 -0
- teradataml/data/naivebayestextclassifier_example.json +8 -0
- teradataml/data/naivebayestextclassifierpredict_example.json +32 -0
- teradataml/data/name_Find_configure.csv +10 -0
- teradataml/data/namedentityfinder_example.json +14 -0
- teradataml/data/namedentityfinderevaluator_example.json +10 -0
- teradataml/data/namedentityfindertrainer_example.json +6 -0
- teradataml/data/nb_iris_input_test.csv +31 -0
- teradataml/data/nb_iris_input_train.csv +121 -0
- teradataml/data/nbp_iris_model.csv +13 -0
- teradataml/data/ner_dict.csv +8 -0
- teradataml/data/ner_extractor_text.csv +2 -0
- teradataml/data/ner_input_eng.csv +7 -0
- teradataml/data/ner_rule.csv +5 -0
- teradataml/data/ner_sports_test2.csv +29 -0
- teradataml/data/ner_sports_train.csv +501 -0
- teradataml/data/nerevaluator_example.json +6 -0
- teradataml/data/nerextractor_example.json +18 -0
- teradataml/data/nermem_sports_test.csv +18 -0
- teradataml/data/nermem_sports_train.csv +51 -0
- teradataml/data/nertrainer_example.json +7 -0
- teradataml/data/ngrams_example.json +7 -0
- teradataml/data/notebooks/__init__.py +0 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Aggregate Functions using SQLAlchemy.ipynb +1455 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Arithmetic Functions Using SQLAlchemy.ipynb +1993 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Bit-Byte Manipulation Functions using SQLAlchemy.ipynb +1492 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Built-in functions using SQLAlchemy.ipynb +536 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Regular Expressions Using SQLAlchemy.ipynb +570 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage String Functions Using SQLAlchemy.ipynb +2559 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Window Aggregate Functions using SQLAlchemy.ipynb +2911 -0
- teradataml/data/notebooks/sqlalchemy/Using Generic SQLAlchemy ClauseElements teradataml DataFrame assign method.ipynb +698 -0
- teradataml/data/notebooks/sqlalchemy/__init__.py +0 -0
- teradataml/data/notebooks/sqlalchemy/teradataml filtering using SQLAlchemy ClauseElements.ipynb +784 -0
- teradataml/data/npath_example.json +23 -0
- teradataml/data/ntree_example.json +14 -0
- teradataml/data/numeric_strings.csv +5 -0
- teradataml/data/numerics.csv +4 -0
- teradataml/data/ocean_buoy.csv +17 -0
- teradataml/data/ocean_buoy2.csv +17 -0
- teradataml/data/ocean_buoys.csv +28 -0
- teradataml/data/ocean_buoys2.csv +10 -0
- teradataml/data/ocean_buoys_nonpti.csv +28 -0
- teradataml/data/ocean_buoys_seq.csv +29 -0
- teradataml/data/onehot_encoder_train.csv +4 -0
- teradataml/data/openml_example.json +92 -0
- teradataml/data/optional_event_table.csv +4 -0
- teradataml/data/orders1.csv +11 -0
- teradataml/data/orders1_12.csv +13 -0
- teradataml/data/orders_ex.csv +4 -0
- teradataml/data/pack_example.json +9 -0
- teradataml/data/package_tracking.csv +19 -0
- teradataml/data/package_tracking_pti.csv +19 -0
- teradataml/data/pagerank_example.json +13 -0
- teradataml/data/paragraphs_input.csv +6 -0
- teradataml/data/pathanalyzer_example.json +8 -0
- teradataml/data/pathgenerator_example.json +8 -0
- teradataml/data/patient_profile.csv +101 -0
- teradataml/data/pattern_matching_data.csv +11 -0
- teradataml/data/payment_fraud_dataset.csv +10001 -0
- teradataml/data/peppers.png +0 -0
- teradataml/data/phrases.csv +7 -0
- teradataml/data/pivot_example.json +9 -0
- teradataml/data/pivot_input.csv +22 -0
- teradataml/data/playerRating.csv +31 -0
- teradataml/data/pos_input.csv +40 -0
- teradataml/data/postagger_example.json +7 -0
- teradataml/data/posttagger_output.csv +44 -0
- teradataml/data/production_data.csv +17 -0
- teradataml/data/production_data2.csv +7 -0
- teradataml/data/randomsample_example.json +32 -0
- teradataml/data/randomwalksample_example.json +9 -0
- teradataml/data/rank_table.csv +6 -0
- teradataml/data/real_values.csv +14 -0
- teradataml/data/ref_mobile_data.csv +4 -0
- teradataml/data/ref_mobile_data_dense.csv +2 -0
- teradataml/data/ref_url.csv +17 -0
- teradataml/data/restaurant_reviews.csv +7 -0
- teradataml/data/retail_churn_table.csv +27772 -0
- teradataml/data/river_data.csv +145 -0
- teradataml/data/roc_example.json +8 -0
- teradataml/data/roc_input.csv +101 -0
- teradataml/data/rule_inputs.csv +6 -0
- teradataml/data/rule_table.csv +2 -0
- teradataml/data/sales.csv +7 -0
- teradataml/data/sales_transaction.csv +501 -0
- teradataml/data/salesdata.csv +342 -0
- teradataml/data/sample_cities.csv +3 -0
- teradataml/data/sample_shapes.csv +11 -0
- teradataml/data/sample_streets.csv +3 -0
- teradataml/data/sampling_example.json +16 -0
- teradataml/data/sax_example.json +17 -0
- teradataml/data/scale_attributes.csv +3 -0
- teradataml/data/scale_example.json +74 -0
- teradataml/data/scale_housing.csv +11 -0
- teradataml/data/scale_housing_test.csv +6 -0
- teradataml/data/scale_input_part_sparse.csv +31 -0
- teradataml/data/scale_input_partitioned.csv +16 -0
- teradataml/data/scale_input_sparse.csv +11 -0
- teradataml/data/scale_parameters.csv +3 -0
- teradataml/data/scale_stat.csv +11 -0
- teradataml/data/scalebypartition_example.json +13 -0
- teradataml/data/scalemap_example.json +13 -0
- teradataml/data/scalesummary_example.json +12 -0
- teradataml/data/score_category.csv +101 -0
- teradataml/data/score_summary.csv +4 -0
- teradataml/data/script_example.json +10 -0
- teradataml/data/scripts/deploy_script.py +84 -0
- teradataml/data/scripts/lightgbm/dataset.template +175 -0
- teradataml/data/scripts/lightgbm/lightgbm_class_functions.template +264 -0
- teradataml/data/scripts/lightgbm/lightgbm_function.template +234 -0
- teradataml/data/scripts/lightgbm/lightgbm_sklearn.template +177 -0
- teradataml/data/scripts/mapper.R +20 -0
- teradataml/data/scripts/mapper.py +16 -0
- teradataml/data/scripts/mapper_replace.py +16 -0
- teradataml/data/scripts/sklearn/__init__.py +0 -0
- teradataml/data/scripts/sklearn/sklearn_fit.py +205 -0
- teradataml/data/scripts/sklearn/sklearn_fit_predict.py +148 -0
- teradataml/data/scripts/sklearn/sklearn_function.template +144 -0
- teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +166 -0
- teradataml/data/scripts/sklearn/sklearn_neighbors.py +161 -0
- teradataml/data/scripts/sklearn/sklearn_score.py +145 -0
- teradataml/data/scripts/sklearn/sklearn_transform.py +327 -0
- teradataml/data/sdk/modelops/modelops_spec.json +101737 -0
- teradataml/data/seeds.csv +10 -0
- teradataml/data/sentenceextractor_example.json +7 -0
- teradataml/data/sentiment_extract_input.csv +11 -0
- teradataml/data/sentiment_train.csv +16 -0
- teradataml/data/sentiment_word.csv +20 -0
- teradataml/data/sentiment_word_input.csv +20 -0
- teradataml/data/sentimentextractor_example.json +24 -0
- teradataml/data/sentimenttrainer_example.json +8 -0
- teradataml/data/sequence_table.csv +10 -0
- teradataml/data/seriessplitter_example.json +8 -0
- teradataml/data/sessionize_example.json +17 -0
- teradataml/data/sessionize_table.csv +116 -0
- teradataml/data/setop_test1.csv +24 -0
- teradataml/data/setop_test2.csv +22 -0
- teradataml/data/soc_nw_edges.csv +11 -0
- teradataml/data/soc_nw_vertices.csv +8 -0
- teradataml/data/souvenir_timeseries.csv +168 -0
- teradataml/data/sparse_iris_attribute.csv +5 -0
- teradataml/data/sparse_iris_test.csv +121 -0
- teradataml/data/sparse_iris_train.csv +601 -0
- teradataml/data/star1.csv +6 -0
- teradataml/data/star_pivot.csv +8 -0
- teradataml/data/state_transition.csv +5 -0
- teradataml/data/stock_data.csv +53 -0
- teradataml/data/stock_movement.csv +11 -0
- teradataml/data/stock_vol.csv +76 -0
- teradataml/data/stop_words.csv +8 -0
- teradataml/data/store_sales.csv +37 -0
- teradataml/data/stringsimilarity_example.json +8 -0
- teradataml/data/strsimilarity_input.csv +13 -0
- teradataml/data/students.csv +101 -0
- teradataml/data/svm_iris_input_test.csv +121 -0
- teradataml/data/svm_iris_input_train.csv +481 -0
- teradataml/data/svm_iris_model.csv +7 -0
- teradataml/data/svmdense_example.json +10 -0
- teradataml/data/svmdensepredict_example.json +19 -0
- teradataml/data/svmsparse_example.json +8 -0
- teradataml/data/svmsparsepredict_example.json +14 -0
- teradataml/data/svmsparsesummary_example.json +8 -0
- teradataml/data/target_mobile_data.csv +13 -0
- teradataml/data/target_mobile_data_dense.csv +5 -0
- teradataml/data/target_udt_data.csv +8 -0
- teradataml/data/tdnerextractor_example.json +14 -0
- teradataml/data/templatedata.csv +1201 -0
- teradataml/data/templates/open_source_ml.json +11 -0
- teradataml/data/teradata_icon.ico +0 -0
- teradataml/data/teradataml_example.json +1473 -0
- teradataml/data/test_classification.csv +101 -0
- teradataml/data/test_loan_prediction.csv +53 -0
- teradataml/data/test_pacf_12.csv +37 -0
- teradataml/data/test_prediction.csv +101 -0
- teradataml/data/test_regression.csv +101 -0
- teradataml/data/test_river2.csv +109 -0
- teradataml/data/text_inputs.csv +6 -0
- teradataml/data/textchunker_example.json +8 -0
- teradataml/data/textclassifier_example.json +7 -0
- teradataml/data/textclassifier_input.csv +7 -0
- teradataml/data/textclassifiertrainer_example.json +7 -0
- teradataml/data/textmorph_example.json +11 -0
- teradataml/data/textparser_example.json +15 -0
- teradataml/data/texttagger_example.json +12 -0
- teradataml/data/texttokenizer_example.json +7 -0
- teradataml/data/texttrainer_input.csv +11 -0
- teradataml/data/tf_example.json +7 -0
- teradataml/data/tfidf_example.json +14 -0
- teradataml/data/tfidf_input1.csv +201 -0
- teradataml/data/tfidf_train.csv +6 -0
- teradataml/data/time_table1.csv +535 -0
- teradataml/data/time_table2.csv +14 -0
- teradataml/data/timeseriesdata.csv +1601 -0
- teradataml/data/timeseriesdatasetsd4.csv +105 -0
- teradataml/data/timestamp_data.csv +4 -0
- teradataml/data/titanic.csv +892 -0
- teradataml/data/titanic_dataset_unpivoted.csv +19 -0
- teradataml/data/to_num_data.csv +4 -0
- teradataml/data/tochar_data.csv +5 -0
- teradataml/data/token_table.csv +696 -0
- 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 +28 -0
- teradataml/data/trans_dense.csv +16 -0
- teradataml/data/trans_sparse.csv +55 -0
- teradataml/data/transformation_table.csv +6 -0
- teradataml/data/transformation_table_new.csv +2 -0
- teradataml/data/tv_spots.csv +16 -0
- teradataml/data/twod_climate_data.csv +117 -0
- teradataml/data/uaf_example.json +529 -0
- teradataml/data/univariatestatistics_example.json +9 -0
- teradataml/data/unpack_example.json +10 -0
- teradataml/data/unpivot_example.json +25 -0
- teradataml/data/unpivot_input.csv +8 -0
- teradataml/data/url_data.csv +10 -0
- teradataml/data/us_air_pass.csv +37 -0
- teradataml/data/us_population.csv +624 -0
- teradataml/data/us_states_shapes.csv +52 -0
- teradataml/data/varmax_example.json +18 -0
- teradataml/data/vectordistance_example.json +30 -0
- teradataml/data/ville_climatedata.csv +121 -0
- teradataml/data/ville_tempdata.csv +12 -0
- teradataml/data/ville_tempdata1.csv +12 -0
- teradataml/data/ville_temperature.csv +11 -0
- teradataml/data/waveletTable.csv +1605 -0
- teradataml/data/waveletTable2.csv +1605 -0
- teradataml/data/weightedmovavg_example.json +9 -0
- teradataml/data/wft_testing.csv +5 -0
- teradataml/data/windowdfft.csv +16 -0
- teradataml/data/wine_data.csv +1600 -0
- teradataml/data/word_embed_input_table1.csv +6 -0
- teradataml/data/word_embed_input_table2.csv +5 -0
- teradataml/data/word_embed_model.csv +23 -0
- teradataml/data/words_input.csv +13 -0
- teradataml/data/xconvolve_complex_left.csv +6 -0
- teradataml/data/xconvolve_complex_leftmulti.csv +6 -0
- teradataml/data/xgboost_example.json +36 -0
- teradataml/data/xgboostpredict_example.json +32 -0
- teradataml/data/ztest_example.json +16 -0
- teradataml/dataframe/__init__.py +0 -0
- teradataml/dataframe/copy_to.py +2446 -0
- teradataml/dataframe/data_transfer.py +2840 -0
- teradataml/dataframe/dataframe.py +20908 -0
- teradataml/dataframe/dataframe_utils.py +2114 -0
- teradataml/dataframe/fastload.py +794 -0
- teradataml/dataframe/functions.py +2110 -0
- teradataml/dataframe/indexer.py +424 -0
- teradataml/dataframe/row.py +160 -0
- teradataml/dataframe/setop.py +1171 -0
- teradataml/dataframe/sql.py +10904 -0
- teradataml/dataframe/sql_function_parameters.py +440 -0
- teradataml/dataframe/sql_functions.py +652 -0
- teradataml/dataframe/sql_interfaces.py +220 -0
- teradataml/dataframe/vantage_function_types.py +675 -0
- teradataml/dataframe/window.py +694 -0
- teradataml/dbutils/__init__.py +3 -0
- teradataml/dbutils/dbutils.py +2871 -0
- teradataml/dbutils/filemgr.py +318 -0
- teradataml/gen_ai/__init__.py +2 -0
- teradataml/gen_ai/convAI.py +473 -0
- teradataml/geospatial/__init__.py +4 -0
- teradataml/geospatial/geodataframe.py +1105 -0
- teradataml/geospatial/geodataframecolumn.py +392 -0
- teradataml/geospatial/geometry_types.py +926 -0
- teradataml/hyperparameter_tuner/__init__.py +1 -0
- teradataml/hyperparameter_tuner/optimizer.py +4115 -0
- teradataml/hyperparameter_tuner/utils.py +303 -0
- teradataml/lib/__init__.py +0 -0
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/lib/libaed_0_1.dylib +0 -0
- teradataml/lib/libaed_0_1.so +0 -0
- teradataml/lib/libaed_0_1_aarch64.so +0 -0
- teradataml/lib/libaed_0_1_ppc64le.so +0 -0
- teradataml/opensource/__init__.py +1 -0
- teradataml/opensource/_base.py +1321 -0
- teradataml/opensource/_class.py +464 -0
- teradataml/opensource/_constants.py +61 -0
- teradataml/opensource/_lightgbm.py +949 -0
- teradataml/opensource/_sklearn.py +1008 -0
- teradataml/opensource/_wrapper_utils.py +267 -0
- teradataml/options/__init__.py +148 -0
- teradataml/options/configure.py +489 -0
- teradataml/options/display.py +187 -0
- teradataml/plot/__init__.py +3 -0
- teradataml/plot/axis.py +1427 -0
- teradataml/plot/constants.py +15 -0
- teradataml/plot/figure.py +431 -0
- teradataml/plot/plot.py +810 -0
- teradataml/plot/query_generator.py +83 -0
- teradataml/plot/subplot.py +216 -0
- teradataml/scriptmgmt/UserEnv.py +4273 -0
- teradataml/scriptmgmt/__init__.py +3 -0
- teradataml/scriptmgmt/lls_utils.py +2157 -0
- teradataml/sdk/README.md +79 -0
- teradataml/sdk/__init__.py +4 -0
- teradataml/sdk/_auth_modes.py +422 -0
- teradataml/sdk/_func_params.py +487 -0
- teradataml/sdk/_json_parser.py +453 -0
- teradataml/sdk/_openapi_spec_constants.py +249 -0
- teradataml/sdk/_utils.py +236 -0
- teradataml/sdk/api_client.py +900 -0
- teradataml/sdk/constants.py +62 -0
- teradataml/sdk/modelops/__init__.py +98 -0
- teradataml/sdk/modelops/_client.py +409 -0
- teradataml/sdk/modelops/_constants.py +304 -0
- teradataml/sdk/modelops/models.py +2308 -0
- teradataml/sdk/spinner.py +107 -0
- teradataml/series/__init__.py +0 -0
- teradataml/series/series.py +537 -0
- teradataml/series/series_utils.py +71 -0
- teradataml/store/__init__.py +12 -0
- teradataml/store/feature_store/__init__.py +0 -0
- teradataml/store/feature_store/constants.py +658 -0
- teradataml/store/feature_store/feature_store.py +4814 -0
- teradataml/store/feature_store/mind_map.py +639 -0
- teradataml/store/feature_store/models.py +7330 -0
- teradataml/store/feature_store/utils.py +390 -0
- teradataml/table_operators/Apply.py +979 -0
- teradataml/table_operators/Script.py +1739 -0
- teradataml/table_operators/TableOperator.py +1343 -0
- teradataml/table_operators/__init__.py +2 -0
- teradataml/table_operators/apply_query_generator.py +262 -0
- teradataml/table_operators/query_generator.py +493 -0
- teradataml/table_operators/table_operator_query_generator.py +462 -0
- teradataml/table_operators/table_operator_util.py +726 -0
- teradataml/table_operators/templates/dataframe_apply.template +184 -0
- teradataml/table_operators/templates/dataframe_map.template +176 -0
- teradataml/table_operators/templates/dataframe_register.template +73 -0
- teradataml/table_operators/templates/dataframe_udf.template +67 -0
- teradataml/table_operators/templates/script_executor.template +170 -0
- teradataml/telemetry_utils/__init__.py +0 -0
- teradataml/telemetry_utils/queryband.py +53 -0
- teradataml/utils/__init__.py +0 -0
- teradataml/utils/docstring.py +527 -0
- teradataml/utils/dtypes.py +943 -0
- teradataml/utils/internal_buffer.py +122 -0
- teradataml/utils/print_versions.py +206 -0
- teradataml/utils/utils.py +451 -0
- teradataml/utils/validators.py +3305 -0
- teradataml-20.0.0.8.dist-info/METADATA +2804 -0
- teradataml-20.0.0.8.dist-info/RECORD +1208 -0
- teradataml-20.0.0.8.dist-info/WHEEL +5 -0
- teradataml-20.0.0.8.dist-info/top_level.txt +1 -0
- teradataml-20.0.0.8.dist-info/zip-safe +1 -0
|
@@ -0,0 +1,1666 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Unpublished work.
|
|
3
|
+
Copyright (c) 2021 by Teradata Corporation. All rights reserved.
|
|
4
|
+
TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
|
|
5
|
+
|
|
6
|
+
Primary Owner: pradeep.garre@teradata.com
|
|
7
|
+
Secondary Owner: PankajVinod.Purandare@teradata.com
|
|
8
|
+
|
|
9
|
+
This file implements _AnlyFuncMetadata for representing the metadata (json data)
|
|
10
|
+
of analytic function. All the functions/API's looking to extract the json data
|
|
11
|
+
should look at corresponding API's in _AnlyFuncMetadata.
|
|
12
|
+
"""
|
|
13
|
+
from collections import OrderedDict
|
|
14
|
+
import json, os, sys
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from re import sub
|
|
17
|
+
from teradataml.analytics.json_parser import PartitionKind, SqleJsonFields, UAFJsonFields, utils
|
|
18
|
+
from teradataml.analytics.json_parser.analytic_functions_argument import _AnlyFuncArgument,\
|
|
19
|
+
_AnlyFuncInput, _AnlyFuncOutput, _DependentArgument, _AnlyFuncArgumentUAF, _AnlyFuncOutputUAF, \
|
|
20
|
+
_AnlyFuncInputUAF
|
|
21
|
+
from teradataml.common.messages import Messages
|
|
22
|
+
from teradataml.common.messagecodes import MessageCodes
|
|
23
|
+
from teradataml.common.constants import TeradataAnalyticFunctionTypes, TeradataUAFSpecificArgs,\
|
|
24
|
+
TeradataAnalyticFunctionInfo
|
|
25
|
+
from teradataml.common.exceptions import TeradataMlException
|
|
26
|
+
from teradataml.common.utils import UtilFuncs
|
|
27
|
+
from teradataml.utils.validators import _Validators
|
|
28
|
+
from teradataml.utils.dtypes import _ListOf
|
|
29
|
+
|
|
30
|
+
class _PairedFunction:
|
|
31
|
+
"""
|
|
32
|
+
Class to hold the paired function information for analytic functions.
|
|
33
|
+
It holds the information about the relation between the analytic
|
|
34
|
+
functions.
|
|
35
|
+
"""
|
|
36
|
+
def __init__(self, function_relation, params):
|
|
37
|
+
"""
|
|
38
|
+
DESCRIPTION:
|
|
39
|
+
Constructor of the class.
|
|
40
|
+
|
|
41
|
+
PARAMETERS:
|
|
42
|
+
function_relation:
|
|
43
|
+
Required Argument.
|
|
44
|
+
Specifies the relation of the paired function.
|
|
45
|
+
Type: str
|
|
46
|
+
|
|
47
|
+
params:
|
|
48
|
+
Required Argument.
|
|
49
|
+
Specifies the reference_function, input_arguments,
|
|
50
|
+
and model_output_argument wrt the paired function.
|
|
51
|
+
Type: dict
|
|
52
|
+
"""
|
|
53
|
+
self.function_relation = function_relation
|
|
54
|
+
self.reference_function = params.get("reference_function", [])
|
|
55
|
+
self.input_arguments = params.get("input_arguments", [])
|
|
56
|
+
self.model_output_arguments = params.get("model_output_arguments", [])
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def arguments(self):
|
|
60
|
+
"""
|
|
61
|
+
DESCRIPTION:
|
|
62
|
+
Function to get the input argument of paired function and output argument of referenced function.
|
|
63
|
+
"""
|
|
64
|
+
for inp_arg, out_arg in zip(self.input_arguments, self.model_output_arguments):
|
|
65
|
+
yield inp_arg, out_arg
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class _AnlyFuncMetadata:
|
|
69
|
+
""" Class to hold the json data. """
|
|
70
|
+
|
|
71
|
+
# A class variable to store the r function names and their function names.
|
|
72
|
+
# Note that this is a class variable so it is accessable from all the objects
|
|
73
|
+
# of _AnlyFuncMetadata.
|
|
74
|
+
_reference_function_names = {
|
|
75
|
+
"aa.glm": "GLM",
|
|
76
|
+
"aa.forest": "DecisionForest",
|
|
77
|
+
"aa.naivebayes.textclassifier.train": "NaiveBayesTextClassifier",
|
|
78
|
+
"aa.svm.sparse.train": "SVMSparse"
|
|
79
|
+
}
|
|
80
|
+
# A class variable to store the SQLE JSON Fields.
|
|
81
|
+
json_fields = SqleJsonFields()
|
|
82
|
+
|
|
83
|
+
def __init__(self, json_data, json_file, func_type=None):
|
|
84
|
+
"""
|
|
85
|
+
DESCRIPTION:
|
|
86
|
+
Constructor for the class.
|
|
87
|
+
|
|
88
|
+
PARAMETERS:
|
|
89
|
+
json_data:
|
|
90
|
+
Required Argument.
|
|
91
|
+
Specifies the json content of analytic function.
|
|
92
|
+
Types: dict
|
|
93
|
+
|
|
94
|
+
json_file:
|
|
95
|
+
Required Argument.
|
|
96
|
+
Specifies the absolute path of the json file.
|
|
97
|
+
Types: str
|
|
98
|
+
|
|
99
|
+
func_type:
|
|
100
|
+
Optional Argument.
|
|
101
|
+
Specifies the type of analytic function.
|
|
102
|
+
Permitted Values: ['FASTPATH', 'TABLE_OPERATOR', 'UAF']
|
|
103
|
+
Types: str
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
# Validate func_type.
|
|
107
|
+
arg_info_matrix = []
|
|
108
|
+
arg_info_matrix.append(
|
|
109
|
+
["func_type", func_type, False,
|
|
110
|
+
(str, type(None)), True, [TeradataAnalyticFunctionTypes.SQLE.value,
|
|
111
|
+
TeradataAnalyticFunctionTypes.TABLEOPERATOR.value,
|
|
112
|
+
TeradataAnalyticFunctionTypes.UAF.value,
|
|
113
|
+
TeradataAnalyticFunctionTypes.BYOM.value,
|
|
114
|
+
TeradataAnalyticFunctionTypes.STORED_PROCEDURE.value,
|
|
115
|
+
None]])
|
|
116
|
+
arg_info_matrix.append(["json_file", json_file, False, str, True])
|
|
117
|
+
_Validators._validate_function_arguments(arg_info_matrix)
|
|
118
|
+
|
|
119
|
+
# Get the appropriate JSON Fields based on the class of the object i.e UAF or SQLE/TABLE_OPERATOR.
|
|
120
|
+
self.short_description = json_data[self.json_fields.SHORT_DESCRIPTION]
|
|
121
|
+
self.long_description = json_data[self.json_fields.LONG_DESCRIPTION]
|
|
122
|
+
# Store Input Table data objects.
|
|
123
|
+
self.__input_tables = []
|
|
124
|
+
# Store Output Table data objects.
|
|
125
|
+
self.__output_tables = []
|
|
126
|
+
# To store mapping between sql name and lang names of Input Tables.
|
|
127
|
+
self.__input_table_lang_names = {}
|
|
128
|
+
# Store rest of function argument objects.
|
|
129
|
+
self.__arguments = []
|
|
130
|
+
|
|
131
|
+
# JSON Object
|
|
132
|
+
self.json_object = json_data
|
|
133
|
+
self._json_file = json_file
|
|
134
|
+
|
|
135
|
+
# Store formula args if applicable.
|
|
136
|
+
self.__formula_args = []
|
|
137
|
+
|
|
138
|
+
# Variable to hold the name of the argument as key and the corresponding section as
|
|
139
|
+
# value. This is used for checking duplicate arguments.
|
|
140
|
+
self.__arguments_and_sections = {}
|
|
141
|
+
self.func_type = json_data[self.json_fields.FUNCTION_TYPE].lower() if func_type is None else func_type.lower()
|
|
142
|
+
self.sql_function_name = json_data[self.json_fields.FUNC_NAME]
|
|
143
|
+
self.func_category = self.json_object.get(self.json_fields.FUNCTION_CATEGORY, None)
|
|
144
|
+
|
|
145
|
+
# Validating func_type and sql_function_name
|
|
146
|
+
self.__arg_info_matrix = []
|
|
147
|
+
self.__arg_info_matrix.append(["func_type", self.func_type, True, str])
|
|
148
|
+
self.__arg_info_matrix.append(["sql_function_name", self.sql_function_name, False, str])
|
|
149
|
+
_Validators._validate_function_arguments(self.__arg_info_matrix)
|
|
150
|
+
|
|
151
|
+
# Generating func_name from the sql_function_name
|
|
152
|
+
self.func_name = self._get_function_name()
|
|
153
|
+
self.__database_version = Path(self._json_file).parts[-2]
|
|
154
|
+
self._func_type_specific_setup()
|
|
155
|
+
|
|
156
|
+
# Call a function read JSON and collect arguments, input
|
|
157
|
+
# and output table arguments.
|
|
158
|
+
self.__parse_json()
|
|
159
|
+
self.__function_params = OrderedDict()
|
|
160
|
+
# Lets store the r function name and the function names in a mapper.
|
|
161
|
+
|
|
162
|
+
# Storing the paired function information
|
|
163
|
+
self.__paired_functions = []
|
|
164
|
+
|
|
165
|
+
def set_paired_functions(self, params):
|
|
166
|
+
"""
|
|
167
|
+
DESCRIPTION:
|
|
168
|
+
Function to set the 'paired_function' attribute of _AnlyFuncMetadata.
|
|
169
|
+
|
|
170
|
+
PARAMETERS:
|
|
171
|
+
params:
|
|
172
|
+
Required Argument
|
|
173
|
+
Specifies the paired function information like the reference_function,
|
|
174
|
+
input_arguments and model_output_arguments.
|
|
175
|
+
Type: dict
|
|
176
|
+
|
|
177
|
+
RETURNS:
|
|
178
|
+
None.
|
|
179
|
+
|
|
180
|
+
RAISES:
|
|
181
|
+
None.
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
# params as
|
|
185
|
+
# {
|
|
186
|
+
# "predict": {
|
|
187
|
+
# "reference_function": "DecisionForestPredict",
|
|
188
|
+
# "input_arguments": ["object"],
|
|
189
|
+
# "model_output_arguments": ["result"]
|
|
190
|
+
# }
|
|
191
|
+
for paired_function_name, paired_function_params in params.items():
|
|
192
|
+
self.__paired_functions.append(
|
|
193
|
+
_PairedFunction(paired_function_name, paired_function_params))
|
|
194
|
+
|
|
195
|
+
def get_paired_functions(self):
|
|
196
|
+
"""
|
|
197
|
+
DESCRIPTION:
|
|
198
|
+
Function to get the '__paired_functions' attribute of _AnlyFuncMetadata class.
|
|
199
|
+
|
|
200
|
+
RETURNS:
|
|
201
|
+
list of instances
|
|
202
|
+
"""
|
|
203
|
+
return self.__paired_functions
|
|
204
|
+
|
|
205
|
+
def _func_type_specific_setup(self):
|
|
206
|
+
"""
|
|
207
|
+
DESCRIPTION:
|
|
208
|
+
Additional setup required for SQLE and Table Operator functions.
|
|
209
|
+
|
|
210
|
+
RETURNS:
|
|
211
|
+
class OR None
|
|
212
|
+
|
|
213
|
+
RAISES:
|
|
214
|
+
None
|
|
215
|
+
"""
|
|
216
|
+
# TODO: Output schema is not required so not storing it for now. If we need it in
|
|
217
|
+
# future, then it can be enabled.
|
|
218
|
+
# Store output schema of the function
|
|
219
|
+
# self.standard_output_schema = self.json_object.get(self.json_fields.OUTPUT_SCHEMA)
|
|
220
|
+
self._is_view_supported = self.json_object.get("supports_view", True)
|
|
221
|
+
self.__is_driver_function = self.json_object.get("function_type", "").lower() == "driver"
|
|
222
|
+
self.__refernce_function_name = self.json_object.get("ref_function_r_name")
|
|
223
|
+
self.__r_function_name = self.json_object.get("function_r_name")
|
|
224
|
+
_AnlyFuncMetadata._reference_function_names[self.__r_function_name] = self.func_name
|
|
225
|
+
|
|
226
|
+
def get_reference_function_class(self):
|
|
227
|
+
"""
|
|
228
|
+
DESCRIPTION:
|
|
229
|
+
Function to get the reference function class. This function checks if the function
|
|
230
|
+
accepts any other function as input. If it accepts, it then returns the class of
|
|
231
|
+
the referenced function.
|
|
232
|
+
|
|
233
|
+
RETURNS:
|
|
234
|
+
class OR None
|
|
235
|
+
|
|
236
|
+
RAISES:
|
|
237
|
+
None
|
|
238
|
+
|
|
239
|
+
EXAMPLES:
|
|
240
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").get_reference_function_class()
|
|
241
|
+
"""
|
|
242
|
+
reference_function = _AnlyFuncMetadata._reference_function_names.get(self.__refernce_function_name)
|
|
243
|
+
if reference_function:
|
|
244
|
+
return UtilFuncs._get_class(reference_function, supress_isinstance_check=True)
|
|
245
|
+
|
|
246
|
+
def _get_argument_value(self, argument_properties, property, section, mandatory=True, default_value=None):
|
|
247
|
+
"""
|
|
248
|
+
DESCRIPTION:
|
|
249
|
+
Function to get the argument value from the json data. This function, checks
|
|
250
|
+
the argument is a mandatory argument or not. If mandatory and not found in json
|
|
251
|
+
data, raises an error otherwise either returns value or default value.
|
|
252
|
+
|
|
253
|
+
PARAMETERS:
|
|
254
|
+
argument_properties:
|
|
255
|
+
Required Argument.
|
|
256
|
+
Specifies json content of one of the below mentioned:
|
|
257
|
+
* Input argument.
|
|
258
|
+
* Output table.
|
|
259
|
+
* Input table.
|
|
260
|
+
Types: dict
|
|
261
|
+
|
|
262
|
+
property:
|
|
263
|
+
Required Argument.
|
|
264
|
+
Specifies the argument name to look in "argument_properties"
|
|
265
|
+
Types: str
|
|
266
|
+
|
|
267
|
+
section:
|
|
268
|
+
Required Argument.
|
|
269
|
+
Specifies the section of the json to which "property" belongs to.
|
|
270
|
+
Types: str
|
|
271
|
+
|
|
272
|
+
mandatory:
|
|
273
|
+
Required Argument.
|
|
274
|
+
Specifies whether "property" is a mandatory field in "argument_properties" or not.
|
|
275
|
+
Default Value: True
|
|
276
|
+
Types: bool
|
|
277
|
+
|
|
278
|
+
default_value:
|
|
279
|
+
Required Argument.
|
|
280
|
+
Specifies the default value of "property".
|
|
281
|
+
Types: str OR int OR float OR bool
|
|
282
|
+
|
|
283
|
+
RETURNS:
|
|
284
|
+
str OR bool OR int OR float OR list
|
|
285
|
+
|
|
286
|
+
RAISES:
|
|
287
|
+
TeradataMlException.
|
|
288
|
+
|
|
289
|
+
EXAMPLES:
|
|
290
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json")._get_argument_value(
|
|
291
|
+
json_data, "defaultValue", "input_tables", False)
|
|
292
|
+
"""
|
|
293
|
+
if property not in argument_properties and mandatory:
|
|
294
|
+
error_message = Messages.get_message(MessageCodes.MISSING_JSON_FIELD,
|
|
295
|
+
property,
|
|
296
|
+
section)
|
|
297
|
+
|
|
298
|
+
raise TeradataMlException(error_message, MessageCodes.MISSING_JSON_FIELD)
|
|
299
|
+
|
|
300
|
+
return argument_properties.get(property, default_value)
|
|
301
|
+
|
|
302
|
+
def _parse_arguments(self):
|
|
303
|
+
"""
|
|
304
|
+
DESCRIPTION:
|
|
305
|
+
Function to parse and store the argument in json file. This function first validates
|
|
306
|
+
whether argument is required for analytic function or not. If required, then arguments
|
|
307
|
+
section in json data is parsed and object of _AnlyFuncArgument is created and stored.
|
|
308
|
+
RETURNS:
|
|
309
|
+
None
|
|
310
|
+
RAISES:
|
|
311
|
+
TeradataMlException.
|
|
312
|
+
EXAMPLES:
|
|
313
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").__parse_arguments()
|
|
314
|
+
"""
|
|
315
|
+
section = self.json_fields.ARGUMENT_CLAUSES
|
|
316
|
+
for argument in self.json_object.get(self.json_fields.ARGUMENT_CLAUSES, []):
|
|
317
|
+
is_argument_required = argument.get(self.json_fields.USEINR, False)
|
|
318
|
+
|
|
319
|
+
# Append argument to list if useInR is True.
|
|
320
|
+
if is_argument_required:
|
|
321
|
+
use_inR = is_argument_required
|
|
322
|
+
|
|
323
|
+
sql_name = self._get_argument_value(argument, self.json_fields.NAME, section)
|
|
324
|
+
|
|
325
|
+
regex_match = self._get_argument_value(argument, self.json_fields.REGEX_MATCH, section, False)
|
|
326
|
+
|
|
327
|
+
match_name = self._get_argument_value(argument, self.json_fields.MATCH_NAME, section, False)
|
|
328
|
+
|
|
329
|
+
lang_name = self._get_argument_value(argument, self.json_fields.LANG_NAME, section, False)
|
|
330
|
+
lang_name = lang_name if lang_name is not None else self._get_pythonic_name_arg_name(
|
|
331
|
+
self._get_argument_value(argument, self.json_fields.R_NAME, section), is_regex_match=regex_match)
|
|
332
|
+
|
|
333
|
+
is_required = self._get_argument_value(argument, self.json_fields.IS_REQUIRED, section)
|
|
334
|
+
|
|
335
|
+
sql_description = self._get_argument_value(argument, self.json_fields.DESCRIPTION, section)
|
|
336
|
+
|
|
337
|
+
r_description = self._get_argument_value(argument, self.json_fields.R_DESCRIPTION, section)
|
|
338
|
+
|
|
339
|
+
datatype = self._get_argument_value(argument, self.json_fields.DATATYPE, section)
|
|
340
|
+
|
|
341
|
+
r_order_num = self._get_argument_value(argument, self.json_fields.R_ORDER_NUM, section)
|
|
342
|
+
|
|
343
|
+
# Look for default value. If default value is not available, the look for default values.
|
|
344
|
+
# If default values found, the consider the first element as default value.
|
|
345
|
+
default_value = self._get_argument_value(argument, self.json_fields.DEFAULT_VALUE, section, False)
|
|
346
|
+
if isinstance(default_value, list):
|
|
347
|
+
default_value = default_value[0]
|
|
348
|
+
|
|
349
|
+
# Json files can specify INFINITY as lower bound. So, convert it to appropriate
|
|
350
|
+
# type in python.
|
|
351
|
+
lower_bound = self._get_argument_value(argument, self.json_fields.LOWER_BOUND, section, False)
|
|
352
|
+
lower_bound = UtilFuncs._get_negative_infinity() if lower_bound == self.json_fields.INFINITY\
|
|
353
|
+
else lower_bound
|
|
354
|
+
|
|
355
|
+
# Json files can specify INFINITY as upper bound. So, convert it to appropriate
|
|
356
|
+
# type in python.
|
|
357
|
+
upper_bound = self._get_argument_value(argument, self.json_fields.UPPER_BOUND, section, False)
|
|
358
|
+
upper_bound = UtilFuncs._get_positive_infinity() if upper_bound == self.json_fields.INFINITY\
|
|
359
|
+
else upper_bound
|
|
360
|
+
|
|
361
|
+
r_default_value = self._get_argument_value(argument, self.json_fields.R_DEFAULT_VALUE, section,
|
|
362
|
+
False)
|
|
363
|
+
|
|
364
|
+
allows_lists = self._get_argument_value(argument, self.json_fields.ALLOWS_LISTS, section, False,
|
|
365
|
+
False)
|
|
366
|
+
|
|
367
|
+
allow_padding = self._get_argument_value(argument, self.json_fields.ALLOW_PADDING, section, False,
|
|
368
|
+
False)
|
|
369
|
+
|
|
370
|
+
r_formula_usage = self._get_argument_value(argument, self.json_fields.R_FORMULA_USAGE, section, False,
|
|
371
|
+
False)
|
|
372
|
+
|
|
373
|
+
allow_nan = self._get_argument_value(argument, self.json_fields.ALLOW_NAN, section, False, False)
|
|
374
|
+
|
|
375
|
+
check_duplicate = self._get_argument_value(argument, self.json_fields.CHECK_DUPLICATE, section, False,
|
|
376
|
+
False)
|
|
377
|
+
|
|
378
|
+
is_output_column = self._get_argument_value(argument, self.json_fields.IS_OUTPUT_COLUMN, section, False,
|
|
379
|
+
False)
|
|
380
|
+
|
|
381
|
+
lower_bound_type = self._get_argument_value(argument, self.json_fields.LOWER_BOUND_TYPE, section, False)
|
|
382
|
+
|
|
383
|
+
upper_bound_type = self._get_argument_value(argument, self.json_fields.UPPER_BOUND_TYPE, section, False)
|
|
384
|
+
|
|
385
|
+
required_length = self._get_argument_value(argument, self.json_fields.REQUIRED_LENGTH, section, False, 0)
|
|
386
|
+
|
|
387
|
+
match_length_of_argument = self._get_argument_value(
|
|
388
|
+
argument, self.json_fields.MATCH_LENGTH_OF_ARGUMENT, section, False, False)
|
|
389
|
+
|
|
390
|
+
permitted_values = self._get_argument_value(argument, self.json_fields.PERMITTED_VALUES, section, False)
|
|
391
|
+
|
|
392
|
+
target_table = self._get_argument_value(argument, self.json_fields.TARGET_TABLE, section, False)
|
|
393
|
+
|
|
394
|
+
allowed_types = self._get_argument_value(argument, self.json_fields.ALLOWED_TYPES, section, False)
|
|
395
|
+
|
|
396
|
+
allowed_type_groups = self._get_argument_value(argument, self.json_fields.ALLOWED_TYPE_GROUPS, section,
|
|
397
|
+
False)
|
|
398
|
+
|
|
399
|
+
alternate_sql_name = self._get_argument_value(argument, self.json_fields.ALTERNATE_NAMES, section, False)
|
|
400
|
+
|
|
401
|
+
# Check for duplicate arguments.
|
|
402
|
+
self._validate_duplicate_argument(lang_name, self.json_fields.ARGUMENT_CLAUSES)
|
|
403
|
+
|
|
404
|
+
# Get the lang name of target table if target table exists for given argument.
|
|
405
|
+
target_table_lang_name = None
|
|
406
|
+
if target_table and len(target_table) > 0:
|
|
407
|
+
target_table_lang_name = self.__get_input_table_lang_name(sql_name=target_table[0])
|
|
408
|
+
|
|
409
|
+
if sql_name.lower() == self.json_fields.SEQUENCE_INPUT_BY or\
|
|
410
|
+
sql_name.lower() == self.json_fields.UNIQUE_ID:
|
|
411
|
+
for j in range(len(self.input_tables)):
|
|
412
|
+
r_order_num = (r_order_num * 10) + j
|
|
413
|
+
|
|
414
|
+
sql_name = self.input_tables[j].get_sql_name()
|
|
415
|
+
datatype = "COLUMN_NAMES"
|
|
416
|
+
|
|
417
|
+
self.arguments.append(_AnlyFuncArgument(default_value=default_value,
|
|
418
|
+
permitted_values=permitted_values,
|
|
419
|
+
lower_bound=lower_bound,
|
|
420
|
+
lower_bound_type=lower_bound_type,
|
|
421
|
+
upper_bound=upper_bound,
|
|
422
|
+
upper_bound_type=upper_bound_type,
|
|
423
|
+
allow_nan=allow_nan,
|
|
424
|
+
required_length=required_length,
|
|
425
|
+
match_length_of_argument=match_length_of_argument,
|
|
426
|
+
sql_name=sql_name,
|
|
427
|
+
is_required=is_required,
|
|
428
|
+
sql_description=sql_description,
|
|
429
|
+
lang_description=r_description,
|
|
430
|
+
datatype=datatype,
|
|
431
|
+
allows_lists=allows_lists,
|
|
432
|
+
allow_padding=allow_padding,
|
|
433
|
+
use_in_r=use_inR,
|
|
434
|
+
r_formula_usage=r_formula_usage,
|
|
435
|
+
r_default_value=r_default_value,
|
|
436
|
+
target_table=target_table,
|
|
437
|
+
target_table_lang_name=target_table_lang_name,
|
|
438
|
+
check_duplicate=check_duplicate,
|
|
439
|
+
allowed_types=allowed_types,
|
|
440
|
+
allowed_type_groups=allowed_type_groups,
|
|
441
|
+
r_order_num=r_order_num,
|
|
442
|
+
is_output_column=is_output_column,
|
|
443
|
+
alternate_sql_name=alternate_sql_name,
|
|
444
|
+
lang_name=lang_name,
|
|
445
|
+
regex_match=regex_match,
|
|
446
|
+
match_name=match_name))
|
|
447
|
+
else:
|
|
448
|
+
self.arguments.append(_AnlyFuncArgument(default_value=default_value,
|
|
449
|
+
permitted_values=permitted_values,
|
|
450
|
+
lower_bound=lower_bound,
|
|
451
|
+
lower_bound_type=lower_bound_type,
|
|
452
|
+
upper_bound=upper_bound,
|
|
453
|
+
upper_bound_type=upper_bound_type,
|
|
454
|
+
allow_nan=allow_nan,
|
|
455
|
+
required_length=required_length,
|
|
456
|
+
match_length_of_argument=match_length_of_argument,
|
|
457
|
+
sql_name=sql_name,
|
|
458
|
+
is_required=is_required,
|
|
459
|
+
sql_description=sql_description,
|
|
460
|
+
lang_description=r_description,
|
|
461
|
+
datatype=datatype,
|
|
462
|
+
allows_lists=allows_lists,
|
|
463
|
+
allow_padding=allow_padding,
|
|
464
|
+
lang_name=lang_name,
|
|
465
|
+
use_in_r=use_inR,
|
|
466
|
+
r_formula_usage=r_formula_usage,
|
|
467
|
+
r_default_value=r_default_value,
|
|
468
|
+
target_table=target_table,
|
|
469
|
+
target_table_lang_name=target_table_lang_name,
|
|
470
|
+
check_duplicate=check_duplicate,
|
|
471
|
+
allowed_types=allowed_types,
|
|
472
|
+
allowed_type_groups=allowed_type_groups,
|
|
473
|
+
r_order_num=r_order_num,
|
|
474
|
+
is_output_column=is_output_column,
|
|
475
|
+
alternate_sql_name=alternate_sql_name,
|
|
476
|
+
regex_match=regex_match,
|
|
477
|
+
match_name=match_name))
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
def _parse_input_tables(self):
|
|
481
|
+
"""
|
|
482
|
+
DESCRIPTION:
|
|
483
|
+
Function to parse and store the input tables in json file. This function first validates
|
|
484
|
+
whether input table is required for analytic function or not. If required, then input tables
|
|
485
|
+
section in json data is parsed and object of _AnlyFuncInput is created and stored.
|
|
486
|
+
|
|
487
|
+
RETURNS:
|
|
488
|
+
None
|
|
489
|
+
|
|
490
|
+
RAISES:
|
|
491
|
+
TeradataMlException.
|
|
492
|
+
|
|
493
|
+
EXAMPLES:
|
|
494
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").__parse_input_tables()
|
|
495
|
+
"""
|
|
496
|
+
section = self.json_fields.INPUT_TABLES
|
|
497
|
+
for input_table_param in self.json_object.get(self.json_fields.INPUT_TABLES, []):
|
|
498
|
+
is_input_table_required = input_table_param.get(self.json_fields.USEINR, False)
|
|
499
|
+
|
|
500
|
+
# Append argument/input table to list if useInR is True.
|
|
501
|
+
if is_input_table_required:
|
|
502
|
+
use_InR = is_input_table_required
|
|
503
|
+
|
|
504
|
+
r_order_num = self._get_argument_value(input_table_param, self.json_fields.R_ORDER_NUM, section)
|
|
505
|
+
|
|
506
|
+
sql_name = self._get_argument_value(input_table_param, self.json_fields.NAME, section)
|
|
507
|
+
|
|
508
|
+
is_required = self._get_argument_value(input_table_param, self.json_fields.IS_REQUIRED, section,
|
|
509
|
+
mandatory=False, default_value=True)
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
sql_description = self._get_argument_value(input_table_param, self.json_fields.DESCRIPTION, section)
|
|
513
|
+
|
|
514
|
+
r_description = self._get_argument_value(input_table_param, self.json_fields.R_DESCRIPTION, section)
|
|
515
|
+
|
|
516
|
+
datatype = self._get_argument_value(input_table_param, self.json_fields.DATATYPE, section)
|
|
517
|
+
|
|
518
|
+
required_input_kind = self._get_argument_value(
|
|
519
|
+
input_table_param, self.json_fields.REQUIRED_INPUT_KIND, section, False, None)
|
|
520
|
+
|
|
521
|
+
partition_by_one = self._get_argument_value(
|
|
522
|
+
input_table_param, self.json_fields.PARTITION_BY_ONE, section, False, False)
|
|
523
|
+
|
|
524
|
+
partition_by_one_inclusive = self._get_argument_value(
|
|
525
|
+
input_table_param, self.json_fields.PARTITION_BY_ONE_INCLUSIVE, section, False, False)
|
|
526
|
+
|
|
527
|
+
is_ordered = self._get_argument_value(input_table_param, self.json_fields.IS_ORDERED, section, False,
|
|
528
|
+
False)
|
|
529
|
+
|
|
530
|
+
is_local_ordered = self._get_argument_value(input_table_param, self.json_fields.IS_LOCAL_ORDERED,
|
|
531
|
+
section, False, False)
|
|
532
|
+
|
|
533
|
+
hash_by_key = self._get_argument_value(input_table_param, self.json_fields.HASH_BY_KEY, section, False,
|
|
534
|
+
False)
|
|
535
|
+
|
|
536
|
+
allows_lists = self._get_argument_value(input_table_param, self.json_fields.ALLOWS_LISTS, section, False,
|
|
537
|
+
False)
|
|
538
|
+
|
|
539
|
+
lang_name = self._get_pythonic_name_arg_name(
|
|
540
|
+
self._get_argument_value(input_table_param, self.json_fields.R_NAME, section))
|
|
541
|
+
|
|
542
|
+
r_formula_usage = self._get_argument_value(input_table_param, self.json_fields.R_FORMULA_USAGE, section,
|
|
543
|
+
False, False)
|
|
544
|
+
|
|
545
|
+
alternate_sql_name = self._get_argument_value(input_table_param, self.json_fields.ALTERNATE_NAMES,
|
|
546
|
+
section, False)
|
|
547
|
+
|
|
548
|
+
# Check for duplicate arguments.
|
|
549
|
+
self._validate_duplicate_argument(lang_name, self.json_fields.INPUT_TABLES)
|
|
550
|
+
|
|
551
|
+
self.input_tables.append(_AnlyFuncInput(required_input_kind=required_input_kind,
|
|
552
|
+
partition_by_one=partition_by_one,
|
|
553
|
+
partition_by_one_inclusive=partition_by_one_inclusive,
|
|
554
|
+
is_ordered=is_ordered,
|
|
555
|
+
hash_by_key=hash_by_key,
|
|
556
|
+
is_local_ordered=is_local_ordered,
|
|
557
|
+
sql_name=sql_name,
|
|
558
|
+
is_required=is_required,
|
|
559
|
+
sql_description=sql_description,
|
|
560
|
+
lang_description=r_description,
|
|
561
|
+
datatype=datatype,
|
|
562
|
+
allows_lists=allows_lists,
|
|
563
|
+
lang_name=lang_name,
|
|
564
|
+
use_in_r=use_InR,
|
|
565
|
+
r_formula_usage=r_formula_usage,
|
|
566
|
+
r_order_num=r_order_num,
|
|
567
|
+
alternate_sql_name=alternate_sql_name))
|
|
568
|
+
# Add entry in map for sql and lang name of input table.
|
|
569
|
+
self.__input_table_lang_names[sql_name.lower()] = lang_name.lower()
|
|
570
|
+
if alternate_sql_name:
|
|
571
|
+
for alter_sql_name in alternate_sql_name:
|
|
572
|
+
self.__input_table_lang_names[alter_sql_name.lower()] = lang_name.lower()
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
def _parse_output_tables(self):
|
|
576
|
+
"""
|
|
577
|
+
DESCRIPTION:
|
|
578
|
+
Function to parse and store the output tables in json file. This function first validates
|
|
579
|
+
whether output table is required for analytic function or not. If required, then output tables
|
|
580
|
+
section in json data is parsed and object of _AnlyFuncOutput is created and stored.
|
|
581
|
+
|
|
582
|
+
RETURNS:
|
|
583
|
+
None
|
|
584
|
+
|
|
585
|
+
RAISES:
|
|
586
|
+
TeradataMlException.
|
|
587
|
+
|
|
588
|
+
EXAMPLES:
|
|
589
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").__parse_output_tables()
|
|
590
|
+
"""
|
|
591
|
+
section = self.json_fields.OUTPUT_TABLES
|
|
592
|
+
for output_table_param in self.json_object.get(self.json_fields.OUTPUT_TABLES, []):
|
|
593
|
+
is_output_table_required = output_table_param.get(self.json_fields.USEINR, False)
|
|
594
|
+
|
|
595
|
+
# Append argument/output table to list if useInR is true.
|
|
596
|
+
if is_output_table_required:
|
|
597
|
+
useInR = is_output_table_required
|
|
598
|
+
|
|
599
|
+
sql_name = self._get_argument_value(output_table_param, self.json_fields.NAME, section)
|
|
600
|
+
|
|
601
|
+
is_required = self._get_argument_value(output_table_param, self.json_fields.IS_REQUIRED, section)
|
|
602
|
+
|
|
603
|
+
sql_description = self._get_argument_value(output_table_param, self.json_fields.DESCRIPTION, section)
|
|
604
|
+
|
|
605
|
+
r_description = self._get_argument_value(output_table_param, self.json_fields.R_DESCRIPTION, section)
|
|
606
|
+
|
|
607
|
+
datatype = self._get_argument_value(output_table_param, self.json_fields.DATATYPE, section)
|
|
608
|
+
|
|
609
|
+
lang_name = self._get_pythonic_name_arg_name(self._get_argument_value(output_table_param,
|
|
610
|
+
self.json_fields.R_NAME, section))
|
|
611
|
+
|
|
612
|
+
r_order_num = self._get_argument_value(output_table_param, self.json_fields.R_ORDER_NUM, section)
|
|
613
|
+
|
|
614
|
+
is_output_table = self._get_argument_value(output_table_param, self.json_fields.IS_OUTPUT_TABLE,
|
|
615
|
+
section, False, False)
|
|
616
|
+
|
|
617
|
+
allows_lists = self._get_argument_value(output_table_param, self.json_fields.ALLOWS_LISTS, section,
|
|
618
|
+
False, False)
|
|
619
|
+
|
|
620
|
+
alternate_sql_name = self._get_argument_value(output_table_param, self.json_fields.ALTERNATE_NAMES,
|
|
621
|
+
section, False)
|
|
622
|
+
|
|
623
|
+
# TODO: Additional dependencies needs to be implemented with ELE-4511.
|
|
624
|
+
is_required_dependent_argument = self._get_argument_value(
|
|
625
|
+
output_table_param, self.json_fields.IS_REQUIRED_DEPENDENT, section, False)
|
|
626
|
+
dependent_argument = None
|
|
627
|
+
if is_required_dependent_argument:
|
|
628
|
+
|
|
629
|
+
argument_type = "input_tables"
|
|
630
|
+
if is_required_dependent_argument.get(self.json_fields.DEPENDENT_ARGUMENT_TYPE) == "argument":
|
|
631
|
+
argument_type = "arguments"
|
|
632
|
+
elif is_required_dependent_argument.get(self.json_fields.DEPENDENT_ARGUMENT_TYPE) == "input_table":
|
|
633
|
+
argument_type = "input_tables"
|
|
634
|
+
|
|
635
|
+
argument_name = is_required_dependent_argument.get(self.json_fields.DEPENDENT_ARGUMENT_NAME)
|
|
636
|
+
operator = is_required_dependent_argument.get(self.json_fields.OPERATOR)
|
|
637
|
+
right_operand = is_required_dependent_argument.get(self.json_fields.DEPENDENT_ARGUMENT_VALUE)
|
|
638
|
+
dependent_argument = _DependentArgument(sql_name=argument_name,
|
|
639
|
+
operator=operator,
|
|
640
|
+
right_operand=right_operand,
|
|
641
|
+
type=argument_type)
|
|
642
|
+
|
|
643
|
+
# TODO: Output schema is not being used any where in processing. So, skipping it for now.
|
|
644
|
+
# output_schema = self._get_argument_value(output_table_param, self.json_fields.OUTPUT_SCHEMA, False)
|
|
645
|
+
|
|
646
|
+
self.output_tables.append(_AnlyFuncOutput(sql_name=sql_name,
|
|
647
|
+
is_required=is_required,
|
|
648
|
+
sql_description=sql_description,
|
|
649
|
+
lang_description=r_description,
|
|
650
|
+
lang_name=lang_name,
|
|
651
|
+
use_in_r=useInR,
|
|
652
|
+
r_order_num=r_order_num,
|
|
653
|
+
is_output_table=is_output_table,
|
|
654
|
+
datatype=datatype,
|
|
655
|
+
allows_lists=allows_lists,
|
|
656
|
+
output_schema=None,
|
|
657
|
+
alternate_sql_name=alternate_sql_name,
|
|
658
|
+
is_required_dependent_argument=dependent_argument))
|
|
659
|
+
|
|
660
|
+
def __parse_json(self):
|
|
661
|
+
try:
|
|
662
|
+
# Parse all input tables.
|
|
663
|
+
self._parse_input_tables()
|
|
664
|
+
|
|
665
|
+
# Parse all output tables.
|
|
666
|
+
self._parse_output_tables()
|
|
667
|
+
|
|
668
|
+
# Parse all arguments.
|
|
669
|
+
self._parse_arguments()
|
|
670
|
+
|
|
671
|
+
except Exception as err:
|
|
672
|
+
teradataml_file_path = os.path.join(*Path(self._json_file).parts[-6:])
|
|
673
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.INVALID_JSON,
|
|
674
|
+
teradataml_file_path,
|
|
675
|
+
str(err)),
|
|
676
|
+
MessageCodes.INVALID_JSON)
|
|
677
|
+
|
|
678
|
+
def __get_analytic_function_args(self):
|
|
679
|
+
"""
|
|
680
|
+
DESCRIPTION:
|
|
681
|
+
Internal function to get the arguments of analytic function, which are required
|
|
682
|
+
to generate function signature. This function iterates through every input
|
|
683
|
+
table and argument, and does the below.
|
|
684
|
+
* Check if argument formulates to an argument "formula" when exposed or not. If yes,
|
|
685
|
+
then the argument should be the first argument and is extracted to a different variable.
|
|
686
|
+
* Function arguments with rOrderNum <= 0 are not supposed to be exposed
|
|
687
|
+
to end user. Ignore these arguments.
|
|
688
|
+
|
|
689
|
+
RAISES:
|
|
690
|
+
None
|
|
691
|
+
|
|
692
|
+
RETURNS:
|
|
693
|
+
tuple, first element specifies formula argument and second element specifies
|
|
694
|
+
list of required arguments for analytic function.
|
|
695
|
+
|
|
696
|
+
EXAMPLES:
|
|
697
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").__get_analytic_function_args()
|
|
698
|
+
"""
|
|
699
|
+
new_args = []
|
|
700
|
+
args = self.input_tables + self.arguments
|
|
701
|
+
|
|
702
|
+
for arg in args:
|
|
703
|
+
r_order_num = arg.get_r_order_number()
|
|
704
|
+
is_argument_formula = isinstance(arg, _AnlyFuncArgument) and arg.is_argument_a_formula() \
|
|
705
|
+
and arg.get_r_order_number() <= 0
|
|
706
|
+
if is_argument_formula:
|
|
707
|
+
if arg.get_r_order_number() == 0:
|
|
708
|
+
self.__dependent_formula_arg = arg
|
|
709
|
+
self.__formula_args.append(arg)
|
|
710
|
+
continue
|
|
711
|
+
|
|
712
|
+
if r_order_num <= 0:
|
|
713
|
+
continue
|
|
714
|
+
|
|
715
|
+
new_args.append(arg)
|
|
716
|
+
return self.__formula_args, new_args
|
|
717
|
+
|
|
718
|
+
def _generate_function_parameters(self):
|
|
719
|
+
"""
|
|
720
|
+
DESCRIPTION:
|
|
721
|
+
Function to generate the analytic function argument names and their corresponding default values.
|
|
722
|
+
Function arguments are generated by adhering to following:
|
|
723
|
+
* Signature includes only input as well as other arguments (SQL: Using clause
|
|
724
|
+
arguments). So, process only those.
|
|
725
|
+
* Output arguments are ignored in the function signature. So, do not process Output arguments.
|
|
726
|
+
* Also, arguments pertaining to partition and order column are also generated for
|
|
727
|
+
input tables.
|
|
728
|
+
|
|
729
|
+
RAISES:
|
|
730
|
+
None
|
|
731
|
+
|
|
732
|
+
RETURNS:
|
|
733
|
+
None
|
|
734
|
+
|
|
735
|
+
EXAMPLES:
|
|
736
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json")._generate_function_parameters()
|
|
737
|
+
"""
|
|
738
|
+
|
|
739
|
+
formula_args, args = self.__get_analytic_function_args()
|
|
740
|
+
|
|
741
|
+
# Formula should always appear as first argument. So, start with formula argument.
|
|
742
|
+
if formula_args:
|
|
743
|
+
self.function_params["formula"] = None
|
|
744
|
+
|
|
745
|
+
for arg in args:
|
|
746
|
+
|
|
747
|
+
arg_name = arg.get_lang_name()
|
|
748
|
+
default_value = arg.get_default_value()
|
|
749
|
+
|
|
750
|
+
# Add argument and default value in the same order.
|
|
751
|
+
self.function_params[arg_name] = default_value
|
|
752
|
+
|
|
753
|
+
def __process_partition_order_columns(self, arg):
|
|
754
|
+
"""
|
|
755
|
+
DESCRIPTION:
|
|
756
|
+
Function to generate the arguments which are related to partition columns
|
|
757
|
+
and order columns arguments.
|
|
758
|
+
|
|
759
|
+
PARAMETERS:
|
|
760
|
+
arg:
|
|
761
|
+
Required Argument.
|
|
762
|
+
Specifies the object of analytic input argument.
|
|
763
|
+
Types: _AnlyFuncInput
|
|
764
|
+
|
|
765
|
+
RAISES:
|
|
766
|
+
None
|
|
767
|
+
|
|
768
|
+
RETURNS:
|
|
769
|
+
None
|
|
770
|
+
|
|
771
|
+
EXAMPLES:
|
|
772
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").__process_partition_order_columns(arg)
|
|
773
|
+
"""
|
|
774
|
+
partition_column_kind = arg._get_partition_column_required_kind()
|
|
775
|
+
partition_value = arg._get_default_partition_by_value(partition_column_kind)
|
|
776
|
+
|
|
777
|
+
# If Function supports only PartitionByOne or PartitionByAny, don't expose
|
|
778
|
+
# partition column to user.
|
|
779
|
+
if arg._only_partition_by_one() or\
|
|
780
|
+
arg._only_partition_by_any():
|
|
781
|
+
pass
|
|
782
|
+
elif partition_column_kind == PartitionKind.KEY or \
|
|
783
|
+
partition_column_kind == PartitionKind.DIMENSIONKEY:
|
|
784
|
+
self.function_params["{}_partition_column".format(arg.get_lang_name())] = None
|
|
785
|
+
elif partition_column_kind in [PartitionKind.ANY,
|
|
786
|
+
PartitionKind.DIMENSIONKEYANY,
|
|
787
|
+
PartitionKind.ONE]:
|
|
788
|
+
self.function_params['{}_partition_column'.format(arg.get_lang_name())] = partition_value
|
|
789
|
+
|
|
790
|
+
# If function type is not a driver or argument is ordered, then add order
|
|
791
|
+
# column also to arguments.
|
|
792
|
+
if not self.__is_driver_function or arg.is_ordered():
|
|
793
|
+
self.function_params["{}_order_column".format(arg.get_lang_name())] = None
|
|
794
|
+
|
|
795
|
+
def __process_hash_local_order_columns(self, arg):
|
|
796
|
+
"""
|
|
797
|
+
DESCRIPTION:
|
|
798
|
+
Generate the arguments related to LOCAL ORDER BY and HASH BY KEY.
|
|
799
|
+
|
|
800
|
+
PARAMETERS:
|
|
801
|
+
arg:
|
|
802
|
+
Required Argument.
|
|
803
|
+
Specifies the object of analytic input argument.
|
|
804
|
+
Types: _AnlyFuncInput
|
|
805
|
+
|
|
806
|
+
RAISES:
|
|
807
|
+
None
|
|
808
|
+
|
|
809
|
+
RETURNS:
|
|
810
|
+
None
|
|
811
|
+
|
|
812
|
+
EXAMPLES:
|
|
813
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").__process_hash_local_order_columns(arg)
|
|
814
|
+
"""
|
|
815
|
+
# If the argument is local ordered, then add "is_local_ordered"
|
|
816
|
+
# as argument.
|
|
817
|
+
if arg.is_local_ordered():
|
|
818
|
+
self.function_params["{}_is_local_ordered".format(arg.get_lang_name())] = False
|
|
819
|
+
# Let's check if function has HASH BY clause.
|
|
820
|
+
if arg.hash_by_key():
|
|
821
|
+
self.function_params['{}_hash_column'.format(arg.get_lang_name())] = None
|
|
822
|
+
|
|
823
|
+
def get_function_parameters_string(self, exclude_args=[]):
|
|
824
|
+
"""
|
|
825
|
+
DESCRIPTION:
|
|
826
|
+
Function to generate the function parameters in string format.
|
|
827
|
+
|
|
828
|
+
RAISES:
|
|
829
|
+
None
|
|
830
|
+
|
|
831
|
+
RETURNS:
|
|
832
|
+
str
|
|
833
|
+
|
|
834
|
+
EXAMPLES:
|
|
835
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").get_function_parameters_string()
|
|
836
|
+
"""
|
|
837
|
+
if not self.function_params:
|
|
838
|
+
self._generate_function_parameters()
|
|
839
|
+
# Along with function parameters, kwargs should be added to accept other parameters.
|
|
840
|
+
return ", ".join(["{} = {}".format(param, '"{}"'.format(value) if isinstance(value, str) else value)
|
|
841
|
+
for param, value in self.function_params.items() if param not in exclude_args] + ["**generic_arguments"])
|
|
842
|
+
|
|
843
|
+
@property
|
|
844
|
+
def input_tables(self):
|
|
845
|
+
"""
|
|
846
|
+
DESCRIPTION:
|
|
847
|
+
Function to return input tables.
|
|
848
|
+
|
|
849
|
+
RETURNS:
|
|
850
|
+
list
|
|
851
|
+
|
|
852
|
+
RAISES:
|
|
853
|
+
None
|
|
854
|
+
|
|
855
|
+
EXAMPLES:
|
|
856
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").input_tables
|
|
857
|
+
"""
|
|
858
|
+
return self.__input_tables
|
|
859
|
+
|
|
860
|
+
@input_tables.setter
|
|
861
|
+
def input_tables(self, input):
|
|
862
|
+
"""
|
|
863
|
+
DESCRIPTION:
|
|
864
|
+
Function to append variable to the input tables list.
|
|
865
|
+
|
|
866
|
+
PARAMETERS:
|
|
867
|
+
input:
|
|
868
|
+
Required Argument.
|
|
869
|
+
Specifies the variable to be appended.
|
|
870
|
+
|
|
871
|
+
RETURNS:
|
|
872
|
+
None
|
|
873
|
+
|
|
874
|
+
RAISES:
|
|
875
|
+
None
|
|
876
|
+
"""
|
|
877
|
+
self.__input_tables.append(input)
|
|
878
|
+
|
|
879
|
+
@property
|
|
880
|
+
def output_tables(self):
|
|
881
|
+
"""
|
|
882
|
+
DESCRIPTION:
|
|
883
|
+
Function to return output tables.
|
|
884
|
+
|
|
885
|
+
RETURNS:
|
|
886
|
+
list
|
|
887
|
+
|
|
888
|
+
RAISES:
|
|
889
|
+
None
|
|
890
|
+
|
|
891
|
+
EXAMPLES:
|
|
892
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").output_tables
|
|
893
|
+
"""
|
|
894
|
+
return self.__output_tables
|
|
895
|
+
|
|
896
|
+
@output_tables.setter
|
|
897
|
+
def output_tables(self, output):
|
|
898
|
+
"""
|
|
899
|
+
DESCRIPTION:
|
|
900
|
+
Function to append variable to the output tables list.
|
|
901
|
+
|
|
902
|
+
PARAMETERS:
|
|
903
|
+
input:
|
|
904
|
+
Required Argument.
|
|
905
|
+
Specifies the variable to be appended.
|
|
906
|
+
|
|
907
|
+
RETURNS:
|
|
908
|
+
None
|
|
909
|
+
|
|
910
|
+
RAISES:
|
|
911
|
+
None
|
|
912
|
+
"""
|
|
913
|
+
self.__output_tables.append(output)
|
|
914
|
+
|
|
915
|
+
@property
|
|
916
|
+
def input_table_lang_names(self):
|
|
917
|
+
"""
|
|
918
|
+
DESCRIPTION:
|
|
919
|
+
Function to return map between sql name and lang name of input tables.
|
|
920
|
+
|
|
921
|
+
RETURNS:
|
|
922
|
+
dict
|
|
923
|
+
|
|
924
|
+
RAISES:
|
|
925
|
+
None
|
|
926
|
+
|
|
927
|
+
EXAMPLES:
|
|
928
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").input_table_lang_names
|
|
929
|
+
"""
|
|
930
|
+
return self.__input_table_lang_names
|
|
931
|
+
|
|
932
|
+
@property
|
|
933
|
+
def arguments(self):
|
|
934
|
+
"""
|
|
935
|
+
DESCRIPTION:
|
|
936
|
+
Function to return arguments.
|
|
937
|
+
|
|
938
|
+
RETURNS:
|
|
939
|
+
list
|
|
940
|
+
|
|
941
|
+
RAISES:
|
|
942
|
+
None
|
|
943
|
+
|
|
944
|
+
EXAMPLES:
|
|
945
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").arguments
|
|
946
|
+
"""
|
|
947
|
+
return self.__arguments
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
@arguments.setter
|
|
951
|
+
def arguments(self, argument):
|
|
952
|
+
"""
|
|
953
|
+
DESCRIPTION:
|
|
954
|
+
Function to append the variable to the arguments list.
|
|
955
|
+
|
|
956
|
+
PARAMETERS:
|
|
957
|
+
argument:
|
|
958
|
+
Required Argument.
|
|
959
|
+
Specifies the variable to be appended.
|
|
960
|
+
|
|
961
|
+
RETURNS:
|
|
962
|
+
None
|
|
963
|
+
|
|
964
|
+
RAISES:
|
|
965
|
+
None
|
|
966
|
+
"""
|
|
967
|
+
self.__arguments.append(argument)
|
|
968
|
+
|
|
969
|
+
@property
|
|
970
|
+
def arguments_and_sections(self):
|
|
971
|
+
"""
|
|
972
|
+
DESCRIPTION:
|
|
973
|
+
Function to return arguments_and_sections.
|
|
974
|
+
|
|
975
|
+
RETURNS:
|
|
976
|
+
list
|
|
977
|
+
|
|
978
|
+
RAISES:
|
|
979
|
+
None
|
|
980
|
+
|
|
981
|
+
EXAMPLES:
|
|
982
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").arguments_and_sections
|
|
983
|
+
"""
|
|
984
|
+
return self.__arguments_and_sections
|
|
985
|
+
|
|
986
|
+
@arguments_and_sections.setter
|
|
987
|
+
def arguments_and_sections(self, argument):
|
|
988
|
+
"""
|
|
989
|
+
DESCRIPTION:
|
|
990
|
+
Function to update the arguments_and_sections dictonary.
|
|
991
|
+
|
|
992
|
+
PARAMETERS:
|
|
993
|
+
argument:
|
|
994
|
+
Required Argument.
|
|
995
|
+
Specifies the variable to be added to the dictonary.
|
|
996
|
+
|
|
997
|
+
RETURNS:
|
|
998
|
+
None
|
|
999
|
+
|
|
1000
|
+
RAISES:
|
|
1001
|
+
None
|
|
1002
|
+
"""
|
|
1003
|
+
self.__arguments_and_sections.update(argument)
|
|
1004
|
+
|
|
1005
|
+
@property
|
|
1006
|
+
def function_params(self):
|
|
1007
|
+
"""
|
|
1008
|
+
DESCRIPTION:
|
|
1009
|
+
Function to get the function_params.
|
|
1010
|
+
|
|
1011
|
+
RETURNS:
|
|
1012
|
+
list
|
|
1013
|
+
|
|
1014
|
+
RAISES:
|
|
1015
|
+
None
|
|
1016
|
+
|
|
1017
|
+
EXAMPLES:
|
|
1018
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").function_params
|
|
1019
|
+
"""
|
|
1020
|
+
return self.__function_params
|
|
1021
|
+
|
|
1022
|
+
@function_params.setter
|
|
1023
|
+
def function_params(self, argument):
|
|
1024
|
+
"""
|
|
1025
|
+
DESCRIPTION:
|
|
1026
|
+
Function to set the function_params.
|
|
1027
|
+
|
|
1028
|
+
PARAMETERS:
|
|
1029
|
+
argument:
|
|
1030
|
+
Required Argument.
|
|
1031
|
+
Specifies the variable to be added to the dictonary.
|
|
1032
|
+
|
|
1033
|
+
RETURNS:
|
|
1034
|
+
list
|
|
1035
|
+
|
|
1036
|
+
RAISES:
|
|
1037
|
+
None
|
|
1038
|
+
|
|
1039
|
+
"""
|
|
1040
|
+
self.__function_params.update(argument)
|
|
1041
|
+
|
|
1042
|
+
@property
|
|
1043
|
+
def formula_args(self):
|
|
1044
|
+
"""
|
|
1045
|
+
DESCRIPTION:
|
|
1046
|
+
Function to return formula arguments.
|
|
1047
|
+
_AnlyFuncMetadata(json_data, "/abc/TD_GLM.json").formula_args
|
|
1048
|
+
"""
|
|
1049
|
+
return self.__formula_args
|
|
1050
|
+
|
|
1051
|
+
@staticmethod
|
|
1052
|
+
def __get_anly_function_name_mapper():
|
|
1053
|
+
"""
|
|
1054
|
+
DESCRIPTION:
|
|
1055
|
+
Function to read mapper file teradataml/analytics/jsons/anly_function_name.json,
|
|
1056
|
+
which has a mapping between function name specified in json file and function to
|
|
1057
|
+
appear in user's context.
|
|
1058
|
+
|
|
1059
|
+
RETURNS:
|
|
1060
|
+
list
|
|
1061
|
+
|
|
1062
|
+
RAISES:
|
|
1063
|
+
None
|
|
1064
|
+
"""
|
|
1065
|
+
return json.loads(
|
|
1066
|
+
UtilFuncs._get_file_contents(os.path.join(UtilFuncs._get_data_directory(dir_name="jsons"),
|
|
1067
|
+
"anly_function_name.json")))
|
|
1068
|
+
|
|
1069
|
+
def _validate_duplicate_argument(self, lang_name, section):
|
|
1070
|
+
"""
|
|
1071
|
+
DESCRIPTION:
|
|
1072
|
+
Internal function to check the duplicates of arguments. No python function
|
|
1073
|
+
accepts duplicate parameters and since analytic functions are being formed at
|
|
1074
|
+
run time from json, there are chances that function may be constructed with
|
|
1075
|
+
duplicate arguments. This function validates whether arguments are duplicated or not.
|
|
1076
|
+
|
|
1077
|
+
PARAMETERS:
|
|
1078
|
+
lang_name:
|
|
1079
|
+
Required Argument.
|
|
1080
|
+
Specifies the name of the argument which is mentioned in json file.
|
|
1081
|
+
Types: str
|
|
1082
|
+
|
|
1083
|
+
section:
|
|
1084
|
+
Required Argument.
|
|
1085
|
+
Specifies the section of json file, to which argument belongs to.
|
|
1086
|
+
Types: str
|
|
1087
|
+
|
|
1088
|
+
RETURNS:
|
|
1089
|
+
None
|
|
1090
|
+
|
|
1091
|
+
RAISES:
|
|
1092
|
+
TeradataMlException
|
|
1093
|
+
|
|
1094
|
+
EXAMPLES:
|
|
1095
|
+
_AnlyFuncMetadata(data, "abc.json")._validate_duplicate_argument("abc", "input_tables")
|
|
1096
|
+
"""
|
|
1097
|
+
if lang_name not in self.arguments_and_sections:
|
|
1098
|
+
self.arguments_and_sections[lang_name] = section
|
|
1099
|
+
else:
|
|
1100
|
+
raise TeradataMlException(Messages.get_message(MessageCodes.DUPLICATE_PARAMETER,
|
|
1101
|
+
lang_name,
|
|
1102
|
+
section),
|
|
1103
|
+
MessageCodes.DUPLICATE_PARAMETER)
|
|
1104
|
+
|
|
1105
|
+
@staticmethod
|
|
1106
|
+
def _get_pythonic_name_arg_name(r_name, is_regex_match=False):
|
|
1107
|
+
"""
|
|
1108
|
+
DESCRIPTION:
|
|
1109
|
+
Function to get the pythonic name for argument from the name specified
|
|
1110
|
+
in json. Conversion of a string to pythonic name does as below:
|
|
1111
|
+
* Strips out the trailing and leading spaces.
|
|
1112
|
+
* Converts the string to lower case.
|
|
1113
|
+
* Replaces the dot(.) with underscore.
|
|
1114
|
+
* Replaces the '_table' with '_data'.
|
|
1115
|
+
* Replaces the 'table_' with 'data_'.
|
|
1116
|
+
|
|
1117
|
+
PARAMETERS:
|
|
1118
|
+
r_name:
|
|
1119
|
+
Required Argument.
|
|
1120
|
+
Specifies the name of the argument which is mentioned in json file.
|
|
1121
|
+
Types: str
|
|
1122
|
+
|
|
1123
|
+
is_regex_match:
|
|
1124
|
+
Optional Argument.
|
|
1125
|
+
Specifies whether regex match is set or not.
|
|
1126
|
+
Default Value: False
|
|
1127
|
+
Types: bool
|
|
1128
|
+
|
|
1129
|
+
RETURNS:
|
|
1130
|
+
str
|
|
1131
|
+
|
|
1132
|
+
RAISES:
|
|
1133
|
+
None
|
|
1134
|
+
|
|
1135
|
+
EXAMPLES:
|
|
1136
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json")._get_pythonic_name_arg_name("abc")
|
|
1137
|
+
"""
|
|
1138
|
+
# When regex_match is set to True, we consider r_name as a regular expression.
|
|
1139
|
+
if is_regex_match:
|
|
1140
|
+
return r_name.strip()
|
|
1141
|
+
return r_name.strip().lower().replace(".", "_").replace("_table", "_data").replace("table_", "data_")
|
|
1142
|
+
|
|
1143
|
+
def _get_function_name(self):
|
|
1144
|
+
"""
|
|
1145
|
+
DESCRIPTION:
|
|
1146
|
+
Function to get the name of the function which is exposed to user.
|
|
1147
|
+
|
|
1148
|
+
RETURNS:
|
|
1149
|
+
str
|
|
1150
|
+
|
|
1151
|
+
RAISES:
|
|
1152
|
+
None
|
|
1153
|
+
|
|
1154
|
+
EXAMPLES:
|
|
1155
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json")._get_function_name()
|
|
1156
|
+
"""
|
|
1157
|
+
# If teradataml/data/jsons/anly_function_name.json contains a mapping name, function name
|
|
1158
|
+
# should be corresponding mapping name. Else, same as function name.
|
|
1159
|
+
|
|
1160
|
+
func_name = self.__get_anly_function_name_mapper().get(self.json_object[self.json_fields.FUNCTION_ALIAS_NAME],
|
|
1161
|
+
self.json_object[self.json_fields.FUNCTION_ALIAS_NAME])
|
|
1162
|
+
# Few functions are expected to have a name starting with TD_,i.e., json file may
|
|
1163
|
+
# contain function name as TD_Xyz. Since we don't want the prefixed characters,
|
|
1164
|
+
# removing those.
|
|
1165
|
+
return func_name[3:] if func_name.startswith("TD_") else func_name
|
|
1166
|
+
|
|
1167
|
+
def get_doc_string(self):
|
|
1168
|
+
"""
|
|
1169
|
+
DESCRIPTION:
|
|
1170
|
+
Function to get the docstring for the function from corresponding docs file.
|
|
1171
|
+
If docs file is not found, return a message asking the user to refer to reference guide.
|
|
1172
|
+
|
|
1173
|
+
PARAMETERS:
|
|
1174
|
+
None.
|
|
1175
|
+
|
|
1176
|
+
RETURNS:
|
|
1177
|
+
str
|
|
1178
|
+
|
|
1179
|
+
RAISES:
|
|
1180
|
+
None
|
|
1181
|
+
|
|
1182
|
+
EXAMPLES:
|
|
1183
|
+
_AnlyFuncMetadata(json_data, "/abc/Antiselect.json").get_doc_string()
|
|
1184
|
+
"""
|
|
1185
|
+
func_info = getattr(TeradataAnalyticFunctionInfo, self.func_type.upper())
|
|
1186
|
+
function_type = func_info.value["func_type"]
|
|
1187
|
+
# For version dependent IN-DB functions, get version info as per vantage version
|
|
1188
|
+
# and then get exact doc dir.
|
|
1189
|
+
# For version independent IN-DB functions, get the docs directory under given
|
|
1190
|
+
# function type.
|
|
1191
|
+
if function_type in utils.func_type_json_version.keys():
|
|
1192
|
+
version_dir = utils.func_type_json_version[function_type]
|
|
1193
|
+
doc_dir = "docs_{}".format(version_dir.replace('.', '_'))
|
|
1194
|
+
else:
|
|
1195
|
+
doc_dir = "docs"
|
|
1196
|
+
try:
|
|
1197
|
+
# from teradataml.data.docs.<function_type>.<doc_dir_with_version_info>.<func_name>
|
|
1198
|
+
# import <func_name>
|
|
1199
|
+
func_module = __import__(("teradataml.data.docs.{}.{}.{}".
|
|
1200
|
+
format(function_type, doc_dir, self.func_name)),
|
|
1201
|
+
fromlist=[self.func_name])
|
|
1202
|
+
return getattr(func_module, self.func_name).__doc__
|
|
1203
|
+
except:
|
|
1204
|
+
# For db_version 20.00, if function type is sqle, then check for docs_17_20 directory.
|
|
1205
|
+
if version_dir == '20.00' and function_type == 'sqle':
|
|
1206
|
+
try:
|
|
1207
|
+
func_module = __import__(("teradataml.data.docs.{}.{}.{}".
|
|
1208
|
+
format(function_type, "docs_17_20", self.func_name)),
|
|
1209
|
+
fromlist=[self.func_name])
|
|
1210
|
+
return getattr(func_module, self.func_name).__doc__
|
|
1211
|
+
except:
|
|
1212
|
+
pass
|
|
1213
|
+
return ("Refer to Teradata Package for Python Function Reference guide for "
|
|
1214
|
+
"Documentation. Reference guide can be found at: https://docs.teradata.com ."
|
|
1215
|
+
"Refer to the section with Database version: {}".format(self.__database_version))
|
|
1216
|
+
|
|
1217
|
+
def __get_input_table_lang_name(self, sql_name):
|
|
1218
|
+
""" Internal function to get lang name of input table when sql name is provided. """
|
|
1219
|
+
if sql_name.lower() in self.__input_table_lang_names.keys():
|
|
1220
|
+
return self.__input_table_lang_names.get(sql_name.lower()).lower()
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
class _AnlyFuncMetadataUAF(_AnlyFuncMetadata):
|
|
1224
|
+
""" Class to hold the UAF json data. """
|
|
1225
|
+
|
|
1226
|
+
# Class variable to hold the UAF json fields.
|
|
1227
|
+
json_fields = UAFJsonFields()
|
|
1228
|
+
|
|
1229
|
+
def __init__(self, json_data, json_file, func_type):
|
|
1230
|
+
self.__input_fmt_arguments = []
|
|
1231
|
+
self.__output_fmt_arguments = []
|
|
1232
|
+
super().__init__(json_data, json_file, func_type)
|
|
1233
|
+
|
|
1234
|
+
@property
|
|
1235
|
+
def input_fmt_arguments(self):
|
|
1236
|
+
"""
|
|
1237
|
+
DESCRIPTION:
|
|
1238
|
+
Property to get the arguments involved in INPUT_FMT section.
|
|
1239
|
+
|
|
1240
|
+
RETURNS:
|
|
1241
|
+
list
|
|
1242
|
+
|
|
1243
|
+
RAISES:
|
|
1244
|
+
None
|
|
1245
|
+
|
|
1246
|
+
EXAMPLES:
|
|
1247
|
+
_AnlyFuncMetadataUAF(json_data, "/abc/ArimaEstimate.json").function_params
|
|
1248
|
+
"""
|
|
1249
|
+
return self.__input_fmt_arguments
|
|
1250
|
+
|
|
1251
|
+
@input_fmt_arguments.setter
|
|
1252
|
+
def input_fmt_arguments(self, argument):
|
|
1253
|
+
"""
|
|
1254
|
+
DESCRIPTION:
|
|
1255
|
+
Property setter for the arguments involved in INPUT_FMT section.
|
|
1256
|
+
|
|
1257
|
+
PARAMETERS:
|
|
1258
|
+
argument:
|
|
1259
|
+
Required Argument.
|
|
1260
|
+
Specifies the variable to be added to the list.
|
|
1261
|
+
Type : _AnlyFuncArgumentUAF
|
|
1262
|
+
|
|
1263
|
+
RETURNS:
|
|
1264
|
+
list
|
|
1265
|
+
|
|
1266
|
+
RAISES:
|
|
1267
|
+
None
|
|
1268
|
+
|
|
1269
|
+
"""
|
|
1270
|
+
self.__input_fmt_arguments.append(argument)
|
|
1271
|
+
|
|
1272
|
+
@property
|
|
1273
|
+
def output_fmt_arguments(self):
|
|
1274
|
+
"""
|
|
1275
|
+
DESCRIPTION:
|
|
1276
|
+
Property to get the arguments involved in OUTPUT_FMT section.
|
|
1277
|
+
|
|
1278
|
+
RETURNS:
|
|
1279
|
+
list
|
|
1280
|
+
|
|
1281
|
+
RAISES:
|
|
1282
|
+
None
|
|
1283
|
+
|
|
1284
|
+
EXAMPLES:
|
|
1285
|
+
_AnlyFuncMetadataUAF(json_data, "/abc/ArimaEstimate.json").function_params
|
|
1286
|
+
"""
|
|
1287
|
+
return self.__output_fmt_arguments
|
|
1288
|
+
|
|
1289
|
+
@output_fmt_arguments.setter
|
|
1290
|
+
def output_fmt_arguments(self, argument):
|
|
1291
|
+
"""
|
|
1292
|
+
DESCRIPTION:
|
|
1293
|
+
Property setter for the arguments involved in OUTPUT_FMT section.
|
|
1294
|
+
|
|
1295
|
+
PARAMETERS:
|
|
1296
|
+
argument:
|
|
1297
|
+
Required Argument.
|
|
1298
|
+
Specifies the variable to be added to the list.
|
|
1299
|
+
Type : _AnlyFuncArgumentUAF
|
|
1300
|
+
|
|
1301
|
+
RETURNS:
|
|
1302
|
+
list
|
|
1303
|
+
|
|
1304
|
+
RAISES:
|
|
1305
|
+
None
|
|
1306
|
+
|
|
1307
|
+
"""
|
|
1308
|
+
self.__output_fmt_arguments.append(argument)
|
|
1309
|
+
|
|
1310
|
+
def _func_type_specific_setup(self):
|
|
1311
|
+
"""
|
|
1312
|
+
DESCRIPTION:
|
|
1313
|
+
Additional setup required for UAF functions.
|
|
1314
|
+
|
|
1315
|
+
RETURNS:
|
|
1316
|
+
None
|
|
1317
|
+
|
|
1318
|
+
RAISES:
|
|
1319
|
+
None
|
|
1320
|
+
"""
|
|
1321
|
+
# Generic Json Parameters
|
|
1322
|
+
self.__function_version = self.json_object[self.json_fields.FUNCTION_VERSION]
|
|
1323
|
+
self.__json_version = self.json_object[self.json_fields.JSON_VERSION]
|
|
1324
|
+
self.__r_function_name = self.json_object[self.json_fields.R_NAME]
|
|
1325
|
+
self.__max_input_files = self.json_object[self.json_fields.MAX_INPUT_FILES]
|
|
1326
|
+
self.__is_plottable = self.json_object[self.json_fields.IS_PLOTTABLE]
|
|
1327
|
+
self.__input_fmt = self.json_object[self.json_fields.INPUT_FMT]
|
|
1328
|
+
self.__output_fmt = self.json_object[self.json_fields.OUTPUT_FMT]
|
|
1329
|
+
|
|
1330
|
+
# Getters
|
|
1331
|
+
self.get_function_version = lambda: self.__function_version
|
|
1332
|
+
self.get_json_version = lambda: self.__json_version
|
|
1333
|
+
self.get_func_r_name = lambda: self.__r_function_name
|
|
1334
|
+
self.get_max_input_files = lambda: self.__max_input_files
|
|
1335
|
+
self.get_is_plottable = lambda: self.__is_plottable
|
|
1336
|
+
self.has_input_fmt = lambda: self.__input_fmt
|
|
1337
|
+
self.has_output_fmt = lambda: self.__output_fmt
|
|
1338
|
+
self._is_view_supported = False
|
|
1339
|
+
|
|
1340
|
+
# Validation
|
|
1341
|
+
self.__arg_info_matrix = []
|
|
1342
|
+
self.__arg_info_matrix.append(["func_description_short", self.short_description, True, str])
|
|
1343
|
+
self.__arg_info_matrix.append(["func_description_long", self.long_description, False, (list, str)])
|
|
1344
|
+
self.__arg_info_matrix.append(["function_version", self.__function_version, True, str])
|
|
1345
|
+
self.__arg_info_matrix.append(["json_version", self.__json_version, True, str])
|
|
1346
|
+
self.__arg_info_matrix.append(["func_r_name", self.__r_function_name, True, str])
|
|
1347
|
+
self.__arg_info_matrix.append(["max_input_files", self.__max_input_files, False, int])
|
|
1348
|
+
self.__arg_info_matrix.append(["is_plottable", self.__is_plottable, False, bool])
|
|
1349
|
+
|
|
1350
|
+
# TODO : uncomment the lines when ELE-5078 is done.
|
|
1351
|
+
# self.__arg_info_matrix.append(["input_fmt", self.__input_fmt, False, (bool, _ListOf(dict)), False, [False]])
|
|
1352
|
+
# self.__arg_info_matrix.append(["output_fmt", self.__output_fmt, False, (bool, _ListOf(dict)), False, [False]])
|
|
1353
|
+
|
|
1354
|
+
self.__arg_info_matrix.append(["input_fmt", self.__input_fmt, False, (bool, _ListOf(dict))])
|
|
1355
|
+
self.__arg_info_matrix.append(["output_fmt", self.__output_fmt, False, (bool, _ListOf(dict))])
|
|
1356
|
+
|
|
1357
|
+
_Validators._validate_function_arguments(self.__arg_info_matrix)
|
|
1358
|
+
|
|
1359
|
+
def __input_params_generation(self, input_table_param, lang_name="data"):
|
|
1360
|
+
"""
|
|
1361
|
+
DESCRIPTION:
|
|
1362
|
+
Function to generate the input parameters and form an object of class _AnlyFuncInputUAF.
|
|
1363
|
+
|
|
1364
|
+
RETURNS:
|
|
1365
|
+
None
|
|
1366
|
+
|
|
1367
|
+
RAISES:
|
|
1368
|
+
None
|
|
1369
|
+
"""
|
|
1370
|
+
section = self.json_fields.INPUT_TABLES
|
|
1371
|
+
data_type = self._get_argument_value(input_table_param, self.json_fields.DATATYPE, section)
|
|
1372
|
+
description = self._get_argument_value(input_table_param, self.json_fields.DESCRIPTION, section)
|
|
1373
|
+
is_required = not self._get_argument_value(input_table_param, self.json_fields.OPTIONAL, section,
|
|
1374
|
+
mandatory=False, default_value=True)
|
|
1375
|
+
# Check for duplicate arguments.
|
|
1376
|
+
self._validate_duplicate_argument(lang_name, self.json_fields.INPUT_TABLES)
|
|
1377
|
+
# Create an object of class _AnlyFuncInputUAF and append to the list.
|
|
1378
|
+
self.input_tables.append(_AnlyFuncInputUAF(data_type=data_type,
|
|
1379
|
+
description=description,
|
|
1380
|
+
lang_name=lang_name,
|
|
1381
|
+
is_required=is_required))
|
|
1382
|
+
|
|
1383
|
+
def _parse_input_tables(self):
|
|
1384
|
+
"""
|
|
1385
|
+
DESCRIPTION:
|
|
1386
|
+
Function to parse and store the input tables in json file. This function first validates
|
|
1387
|
+
whether input table is required for analytic function or not. If required, then input tables
|
|
1388
|
+
section in json data is parsed and object of _AnlyFuncInputUAF is created and stored.
|
|
1389
|
+
|
|
1390
|
+
RETURNS:
|
|
1391
|
+
None
|
|
1392
|
+
|
|
1393
|
+
RAISES:
|
|
1394
|
+
None
|
|
1395
|
+
"""
|
|
1396
|
+
|
|
1397
|
+
|
|
1398
|
+
if len(self.json_object[self.json_fields.INPUT_TABLES]) == 1:
|
|
1399
|
+
input_table_param = self.json_object[self.json_fields.INPUT_TABLES][0]
|
|
1400
|
+
self.__input_params_generation(input_table_param)
|
|
1401
|
+
else:
|
|
1402
|
+
for counter, input_table_param in enumerate(self.json_object[self.json_fields.INPUT_TABLES], 1):
|
|
1403
|
+
lang_name = "data{}".format(counter)
|
|
1404
|
+
self.__input_params_generation(input_table_param, lang_name)
|
|
1405
|
+
|
|
1406
|
+
def _parse_output_tables(self):
|
|
1407
|
+
"""
|
|
1408
|
+
DESCRIPTION:
|
|
1409
|
+
Function to parse and store the output tables in json file. This function first validates
|
|
1410
|
+
whether output table is required for analytic function or not. If required, then output tables
|
|
1411
|
+
section in json data is parsed and object of _AnlyFuncOutputUAF is created and stored.
|
|
1412
|
+
|
|
1413
|
+
RETURNS:
|
|
1414
|
+
None
|
|
1415
|
+
|
|
1416
|
+
RAISES:
|
|
1417
|
+
None
|
|
1418
|
+
"""
|
|
1419
|
+
section = self.json_fields.OUTPUT_TABLES
|
|
1420
|
+
|
|
1421
|
+
for output_table_param in self.json_object[self.json_fields.OUTPUT_TABLES]:
|
|
1422
|
+
# Specifies the output type.
|
|
1423
|
+
data_type = self._get_argument_value(output_table_param, self.json_fields.DATATYPE, section)
|
|
1424
|
+
|
|
1425
|
+
# Specifies the column types for the result table.
|
|
1426
|
+
result_table_column_types = self._get_argument_value(output_table_param,
|
|
1427
|
+
self.json_fields.RESULT_TABLE_COLUMN_TYPES, section, False)
|
|
1428
|
+
# Specifies the output description.
|
|
1429
|
+
description = self._get_argument_value(output_table_param, self.json_fields.DESCRIPTION, section)
|
|
1430
|
+
|
|
1431
|
+
# Specifies whether the argument is required or not.
|
|
1432
|
+
is_required = not self._get_argument_value(output_table_param, self.json_fields.OPTIONAL, section, False)
|
|
1433
|
+
|
|
1434
|
+
# Specifies whether the layer is primary or not.
|
|
1435
|
+
primary_layer = self._get_argument_value(output_table_param, self.json_fields.PRIMARY_LAYER, section)
|
|
1436
|
+
|
|
1437
|
+
# Specifies the name of the output layer.
|
|
1438
|
+
layer_name = self._get_argument_value(output_table_param, self.json_fields.LAYER_NAME, section)
|
|
1439
|
+
|
|
1440
|
+
# Use the layer name as lang_name.
|
|
1441
|
+
# Remove 'art' if present in the first three characters from the layer_name.
|
|
1442
|
+
lang_name = layer_name.lower()[3:] if layer_name.lower()[:3] in "art" else layer_name.lower()
|
|
1443
|
+
|
|
1444
|
+
self.output_tables.append(_AnlyFuncOutputUAF(data_type=data_type,
|
|
1445
|
+
description=description,
|
|
1446
|
+
lang_name=lang_name,
|
|
1447
|
+
layer_name=layer_name,
|
|
1448
|
+
primary_layer=primary_layer,
|
|
1449
|
+
result_table_column_types=result_table_column_types,
|
|
1450
|
+
is_required=is_required))
|
|
1451
|
+
|
|
1452
|
+
def __argument_parser(self, argument, section, parent = None, is_nested=False, prev_lang_name=None):
|
|
1453
|
+
"""
|
|
1454
|
+
DESCRIPTION:
|
|
1455
|
+
Internal function to parse the individual argument in json file.
|
|
1456
|
+
Nested arguments if present in json data, are parsed and object of _AnlyFuncArgumentUAF
|
|
1457
|
+
are appended to the nested_parameter_list.
|
|
1458
|
+
Used for parsing UAF function arguments under section 'func_params' in JSON file.
|
|
1459
|
+
|
|
1460
|
+
RETURNS:
|
|
1461
|
+
object of _AnlyFuncArgumentUAF
|
|
1462
|
+
|
|
1463
|
+
RAISES:
|
|
1464
|
+
TeradataMlException.
|
|
1465
|
+
"""
|
|
1466
|
+
sql_name = UtilFuncs._as_list(self._get_argument_value(argument, self.json_fields.NAME, section))
|
|
1467
|
+
|
|
1468
|
+
for name in sql_name:
|
|
1469
|
+
sql_name = name
|
|
1470
|
+
is_required = not self._get_argument_value(argument, self.json_fields.OPTIONAL, section, mandatory=False,
|
|
1471
|
+
default_value=True)
|
|
1472
|
+
sql_description = self._get_argument_value(argument, self.json_fields.DESCRIPTION, section)
|
|
1473
|
+
|
|
1474
|
+
datatype = self._get_argument_value(argument, self.json_fields.DATATYPE, section)
|
|
1475
|
+
nested_params_json = self._get_argument_value(argument, self.json_fields.NESTED_PARAMS_JSON, section,
|
|
1476
|
+
mandatory=False, default_value=None)
|
|
1477
|
+
# Validate whether nested params exist only if data type is a record.
|
|
1478
|
+
if datatype == "record":
|
|
1479
|
+
if nested_params_json is None:
|
|
1480
|
+
raise TeradataMlException("For json: {} and parameter with name : {} nested_parameters should"
|
|
1481
|
+
" be present as type is 'record'.".format(self.sql_function_name,
|
|
1482
|
+
sql_name))
|
|
1483
|
+
else:
|
|
1484
|
+
if nested_params_json is not None:
|
|
1485
|
+
raise TeradataMlException("For json: {} and parameter with name : {} type should be"
|
|
1486
|
+
" 'record' as nested_parameters exist.".format(self.sql_function_name,
|
|
1487
|
+
sql_name))
|
|
1488
|
+
|
|
1489
|
+
# Look for default value. If list of default values are found,
|
|
1490
|
+
# the consider the first element as default value.
|
|
1491
|
+
default_value = self._get_argument_value(argument, self.json_fields.DEFAULT_VALUE, section, mandatory=False)
|
|
1492
|
+
|
|
1493
|
+
# Json files can specify INFINITY as lower bound. So, convert it to appropriate
|
|
1494
|
+
# type in python.
|
|
1495
|
+
lower_bound = self._get_argument_value(argument, self.json_fields.LOWER_BOUND, section, mandatory=False)
|
|
1496
|
+
lower_bound = UtilFuncs._get_negative_infinity() if lower_bound == self.json_fields.INFINITY else lower_bound
|
|
1497
|
+
|
|
1498
|
+
# Json files can specify INFINITY as upper bound. So, convert it to appropriate
|
|
1499
|
+
# type in python.
|
|
1500
|
+
upper_bound = self._get_argument_value(argument, self.json_fields.UPPER_BOUND, section, mandatory=False)
|
|
1501
|
+
upper_bound = UtilFuncs._get_positive_infinity() if upper_bound == self.json_fields.INFINITY else upper_bound
|
|
1502
|
+
|
|
1503
|
+
allow_nan = self._get_argument_value(argument, self.json_fields.ALLOW_NAN, section, mandatory=False,
|
|
1504
|
+
default_value=False)
|
|
1505
|
+
check_duplicates = self._get_argument_value(argument, self.json_fields.CHECK_DUPLICATE, section, mandatory=False,
|
|
1506
|
+
default_value=False)
|
|
1507
|
+
lower_bound_type = self._get_argument_value(argument, self.json_fields.LOWER_BOUND_TYPE, section, mandatory=False)
|
|
1508
|
+
upper_bound_type = self._get_argument_value(argument, self.json_fields.UPPER_BOUND_TYPE, section, mandatory=False)
|
|
1509
|
+
required_length = self._get_argument_value(argument, self.json_fields.REQUIRED_LENGTH, section, mandatory=False,
|
|
1510
|
+
default_value=0)
|
|
1511
|
+
permitted_values = self._get_argument_value(argument, self.json_fields.PERMITTED_VALUES, section, mandatory=False)
|
|
1512
|
+
|
|
1513
|
+
list_type = self._get_argument_value(argument, self.json_fields.LIST_TYPE, section, mandatory=False)
|
|
1514
|
+
|
|
1515
|
+
# If lang_name is present in the JSON and is not equal to '...' use the lang_name from the JSON
|
|
1516
|
+
# else lang name is equal to Pythonic sql_name.
|
|
1517
|
+
lang_name = self._get_argument_value(argument, self.json_fields.LANG_NAME, section, mandatory=False)
|
|
1518
|
+
lang_name = lang_name if lang_name is not None and lang_name != "..."\
|
|
1519
|
+
else "_".join(filter(None, [prev_lang_name, self._get_pythonic_name_arg_name(sql_name)]))
|
|
1520
|
+
|
|
1521
|
+
has_nested = False
|
|
1522
|
+
nested_param_list = []
|
|
1523
|
+
# Loop over the nested params if present and call the function in recursive manner.
|
|
1524
|
+
if nested_params_json is not None:
|
|
1525
|
+
has_nested = True
|
|
1526
|
+
for nested_arg in nested_params_json:
|
|
1527
|
+
for nested_list in self.__argument_parser(argument=nested_arg,
|
|
1528
|
+
section=section,
|
|
1529
|
+
parent=sql_name,
|
|
1530
|
+
is_nested=True,
|
|
1531
|
+
prev_lang_name=lang_name):
|
|
1532
|
+
nested_param_list.append(nested_list)
|
|
1533
|
+
yield _AnlyFuncArgumentUAF(data_type=datatype,
|
|
1534
|
+
description=sql_description,
|
|
1535
|
+
name=sql_name,
|
|
1536
|
+
is_required=is_required,
|
|
1537
|
+
permitted_values=permitted_values,
|
|
1538
|
+
lower_bound=lower_bound,
|
|
1539
|
+
upper_bound=upper_bound,
|
|
1540
|
+
lower_bound_type=lower_bound_type,
|
|
1541
|
+
upper_bound_type=upper_bound_type,
|
|
1542
|
+
check_duplicates=check_duplicates,
|
|
1543
|
+
list_type=list_type,
|
|
1544
|
+
allow_nan=allow_nan,
|
|
1545
|
+
lang_name=lang_name,
|
|
1546
|
+
default_value=default_value,
|
|
1547
|
+
required_length=required_length,
|
|
1548
|
+
parent = parent,
|
|
1549
|
+
is_nested = is_nested,
|
|
1550
|
+
has_nested = has_nested,
|
|
1551
|
+
nested_param_list=nested_param_list)
|
|
1552
|
+
|
|
1553
|
+
def _process_arg_sections(self, section=None, arg_list_name=None):
|
|
1554
|
+
"""
|
|
1555
|
+
DESCRIPTION:
|
|
1556
|
+
Function to loop over the ARGUMENT_CLAUSES, INPUT_FMT and OUTPUT_FMT sections,
|
|
1557
|
+
call the __argument_parser and populate the corresponding lists
|
|
1558
|
+
with the objects of _AnlyFuncArgumentUAF .
|
|
1559
|
+
|
|
1560
|
+
RETURNS:
|
|
1561
|
+
None
|
|
1562
|
+
|
|
1563
|
+
RAISES:
|
|
1564
|
+
None
|
|
1565
|
+
"""
|
|
1566
|
+
for argument in self.json_object.get(section, []):
|
|
1567
|
+
for arg_list in self.__argument_parser(argument, section):
|
|
1568
|
+
getattr(self, arg_list_name).append(arg_list)
|
|
1569
|
+
|
|
1570
|
+
def _parse_arguments(self):
|
|
1571
|
+
"""
|
|
1572
|
+
DESCRIPTION:
|
|
1573
|
+
Function to process argument section and input_fmt and output_fmt sections, if present.
|
|
1574
|
+
|
|
1575
|
+
RETURNS:
|
|
1576
|
+
None
|
|
1577
|
+
|
|
1578
|
+
RAISES:
|
|
1579
|
+
None
|
|
1580
|
+
"""
|
|
1581
|
+
# Parse all arguments.
|
|
1582
|
+
self._process_arg_sections(section=self.json_fields.ARGUMENT_CLAUSES, arg_list_name="arguments")
|
|
1583
|
+
|
|
1584
|
+
# Parse input_fmt section.
|
|
1585
|
+
if self.has_input_fmt():
|
|
1586
|
+
self._process_arg_sections(section=self.json_fields.INPUT_FMT, arg_list_name="input_fmt_arguments")
|
|
1587
|
+
|
|
1588
|
+
# Parse output_fmt section.
|
|
1589
|
+
if self.has_output_fmt():
|
|
1590
|
+
self._process_arg_sections(section=self.json_fields.OUTPUT_FMT, arg_list_name="output_fmt_arguments")
|
|
1591
|
+
|
|
1592
|
+
def __update_function_params_uaf_argument(self, argument):
|
|
1593
|
+
"""
|
|
1594
|
+
DESCRIPTION:
|
|
1595
|
+
Function to update the function_params list with argument's lang_name and default value.
|
|
1596
|
+
If arguments have nested parameters, the lang_name and default value of the nested_parameters
|
|
1597
|
+
are appended to the function_params list and not the parent element.
|
|
1598
|
+
|
|
1599
|
+
RETURNS:
|
|
1600
|
+
None
|
|
1601
|
+
|
|
1602
|
+
RAISES:
|
|
1603
|
+
None
|
|
1604
|
+
"""
|
|
1605
|
+
if argument.get_has_nested():
|
|
1606
|
+
for nested_arg in argument.get_nested_param_list():
|
|
1607
|
+
self.__update_function_params_uaf_argument(nested_arg)
|
|
1608
|
+
else:
|
|
1609
|
+
r_default_value = argument.get_r_default_value()
|
|
1610
|
+
default_value = r_default_value if r_default_value is not None else \
|
|
1611
|
+
argument.get_default_value()
|
|
1612
|
+
self.function_params[argument.get_lang_name()] = default_value
|
|
1613
|
+
|
|
1614
|
+
def _generate_function_parameters(self):
|
|
1615
|
+
"""
|
|
1616
|
+
DESCRIPTION:
|
|
1617
|
+
Function to generate the UAF function argument names and their corresponding default values.
|
|
1618
|
+
Function arguments are generated by adhering to following:
|
|
1619
|
+
* Signature includes only input as well as other arguments (SQL: Using clause
|
|
1620
|
+
arguments). So, process only those.
|
|
1621
|
+
* Output arguments are ignored in the function signature. So, do not process Output arguments.
|
|
1622
|
+
* Also, arguments pertaining to input_format and output_format are added.
|
|
1623
|
+
|
|
1624
|
+
RETURNS:
|
|
1625
|
+
None
|
|
1626
|
+
|
|
1627
|
+
RAISES:
|
|
1628
|
+
None
|
|
1629
|
+
"""
|
|
1630
|
+
# Process input arguments
|
|
1631
|
+
for input_args in self.input_tables:
|
|
1632
|
+
lang_name = input_args.get_lang_name()
|
|
1633
|
+
filter_exp = "{}_filter_expr".format(lang_name)
|
|
1634
|
+
self.function_params.update({lang_name: input_args.get_default_value(),
|
|
1635
|
+
filter_exp: input_args.get_default_value()})
|
|
1636
|
+
|
|
1637
|
+
# Process arguments section.
|
|
1638
|
+
parameters = []
|
|
1639
|
+
for argument in self.arguments:
|
|
1640
|
+
self.__update_function_params_uaf_argument(argument)
|
|
1641
|
+
|
|
1642
|
+
# If has_input_fmt is True, add arguments related to input_fmt.
|
|
1643
|
+
if self.has_input_fmt():
|
|
1644
|
+
for argument in self.input_fmt_arguments:
|
|
1645
|
+
self.__update_function_params_uaf_argument(argument)
|
|
1646
|
+
|
|
1647
|
+
# If has_output_fmt() is True, then parameters related to output_fmt are added.
|
|
1648
|
+
if self.has_output_fmt():
|
|
1649
|
+
for argument in self.output_fmt_arguments:
|
|
1650
|
+
self.__update_function_params_uaf_argument(argument)
|
|
1651
|
+
|
|
1652
|
+
def _get_function_name(self):
|
|
1653
|
+
"""
|
|
1654
|
+
DESCRIPTION:
|
|
1655
|
+
Function to get the pythonic name of the function from the R_NAME
|
|
1656
|
+
which is to be exposed to user.
|
|
1657
|
+
|
|
1658
|
+
RETURNS:
|
|
1659
|
+
str
|
|
1660
|
+
|
|
1661
|
+
RAISES:
|
|
1662
|
+
None
|
|
1663
|
+
"""
|
|
1664
|
+
func_name = self.json_object[self.json_fields.R_NAME]
|
|
1665
|
+
func_name = sub(r"(_|-)+", "", func_name[3:])
|
|
1666
|
+
return func_name
|