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,1261 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Unpublished work.
|
|
3
|
+
Copyright (c) 2025 by Teradata Corporation. All rights reserved.
|
|
4
|
+
TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
|
|
5
|
+
|
|
6
|
+
Primary Owner: akhil.bisht@teradata.com
|
|
7
|
+
Secondary Owner: pankajvinod.purandare@teradata.com
|
|
8
|
+
|
|
9
|
+
This file implements the TeradataMlLogger for session-level logging in teradataml.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
import sys
|
|
14
|
+
import time
|
|
15
|
+
import logging
|
|
16
|
+
import functools
|
|
17
|
+
import traceback
|
|
18
|
+
from teradataml.utils.validators import _Validators
|
|
19
|
+
from teradataml.common.constants import LoggingLevel
|
|
20
|
+
|
|
21
|
+
# Define logging methods for dynamic access
|
|
22
|
+
_LOG_METHODS = ['info', 'debug', 'warning', 'error', 'exception']
|
|
23
|
+
|
|
24
|
+
class _TeradataMlLogger:
|
|
25
|
+
"""
|
|
26
|
+
Isolated teradataml-specific logger instance that doesn't interfere with global logging.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def __init__(self, name="teradataml", level=logging.INFO, prf_time=False):
|
|
30
|
+
"""
|
|
31
|
+
DESCRIPTION:
|
|
32
|
+
Initialize the teradataml-specific logger instance.
|
|
33
|
+
Note:
|
|
34
|
+
* This logger is isolated and does not propagate to the root logger.
|
|
35
|
+
* By default, it uses '%(asctime)s | %(levelname)-8s | %(message)s' format for log messages.
|
|
36
|
+
|
|
37
|
+
PARAMETERS:
|
|
38
|
+
name:
|
|
39
|
+
Optional Argument.
|
|
40
|
+
Specifies the name for the logger instance.
|
|
41
|
+
Default Value: "teradataml"
|
|
42
|
+
Types: str
|
|
43
|
+
|
|
44
|
+
level:
|
|
45
|
+
Optional Argument.
|
|
46
|
+
Specifies the initial logging level.
|
|
47
|
+
Default Value: logging.INFO
|
|
48
|
+
Permitted Values: logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR
|
|
49
|
+
Types: int
|
|
50
|
+
|
|
51
|
+
prf_time:
|
|
52
|
+
Optional Argument.
|
|
53
|
+
Specifies whether to show performance time logging in all functions.
|
|
54
|
+
Default Value: False
|
|
55
|
+
Types: bool
|
|
56
|
+
|
|
57
|
+
RETURNS:
|
|
58
|
+
None
|
|
59
|
+
|
|
60
|
+
RAISES:
|
|
61
|
+
None
|
|
62
|
+
|
|
63
|
+
EXAMPLES:
|
|
64
|
+
>>> logger = _TeradataMlLogger()
|
|
65
|
+
>>> logger = _TeradataMlLogger("CustomLogger", logging.DEBUG, True)
|
|
66
|
+
"""
|
|
67
|
+
# Validate argument types
|
|
68
|
+
argument_validation_params = []
|
|
69
|
+
argument_validation_params.append(['name', name, False, str, True])
|
|
70
|
+
argument_validation_params.append(['level', level, False, int, True, [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR]])
|
|
71
|
+
argument_validation_params.append(['prf_time', prf_time, False, bool, True])
|
|
72
|
+
_Validators._validate_function_arguments(argument_validation_params)
|
|
73
|
+
|
|
74
|
+
self._logger = logging.getLogger(f"{name}")
|
|
75
|
+
self._logger.setLevel(logging.DEBUG) # Allow all levels internally
|
|
76
|
+
self._current_level = level
|
|
77
|
+
self._handlers = []
|
|
78
|
+
self._prf_time = prf_time # Simple boolean flag
|
|
79
|
+
self._formatter = logging.Formatter('%(asctime)s | %(levelname)-8s | %(message)s') # Default formatter with fixed-width levels
|
|
80
|
+
|
|
81
|
+
# Clear any existing handlers to ensure clean state
|
|
82
|
+
self._logger.handlers.clear()
|
|
83
|
+
self._logger.propagate = False # Don't propagate to root logger - ISOLATED!
|
|
84
|
+
|
|
85
|
+
def _set_level(self, level):
|
|
86
|
+
"""
|
|
87
|
+
DESCRIPTION:
|
|
88
|
+
Set the effective logging level for the logger instance.
|
|
89
|
+
|
|
90
|
+
PARAMETERS:
|
|
91
|
+
level:
|
|
92
|
+
Required Argument.
|
|
93
|
+
Specifies the logging level to set.
|
|
94
|
+
Permitted Values: logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR
|
|
95
|
+
Types: int
|
|
96
|
+
|
|
97
|
+
RETURNS:
|
|
98
|
+
None
|
|
99
|
+
|
|
100
|
+
RAISES:
|
|
101
|
+
None
|
|
102
|
+
|
|
103
|
+
EXAMPLES:
|
|
104
|
+
>>> logger = _TeradataMlLogger()
|
|
105
|
+
>>> logger._set_level(logging.DEBUG)
|
|
106
|
+
>>> logger._set_level(logging.WARNING)
|
|
107
|
+
"""
|
|
108
|
+
self._current_level = level
|
|
109
|
+
# Update all handlers
|
|
110
|
+
for handler in self._handlers:
|
|
111
|
+
handler.setLevel(level)
|
|
112
|
+
|
|
113
|
+
def _set_formatter(self, formatter=None):
|
|
114
|
+
"""
|
|
115
|
+
DESCRIPTION:
|
|
116
|
+
Set a custom formatter for the logger instance and update all existing handlers.
|
|
117
|
+
If no formatter is provided, resets to default formatter.
|
|
118
|
+
|
|
119
|
+
PARAMETERS:
|
|
120
|
+
formatter:
|
|
121
|
+
Optional Argument.
|
|
122
|
+
Specifies the logging formatter to use.
|
|
123
|
+
Default Value: None (uses default formatter)
|
|
124
|
+
Types: logging.Formatter
|
|
125
|
+
|
|
126
|
+
RETURNS:
|
|
127
|
+
None
|
|
128
|
+
|
|
129
|
+
RAISES:
|
|
130
|
+
None
|
|
131
|
+
|
|
132
|
+
EXAMPLES:
|
|
133
|
+
>>> logger = _TeradataMlLogger()
|
|
134
|
+
>>> custom_formatter = logging.Formatter('%(levelname)s: %(message)s')
|
|
135
|
+
>>> logger._set_formatter(custom_formatter)
|
|
136
|
+
>>> logger.set_formatter() # Reset to default
|
|
137
|
+
"""
|
|
138
|
+
if formatter is not None:
|
|
139
|
+
self._formatter = formatter
|
|
140
|
+
|
|
141
|
+
# Update all existing handlers with the new formatter
|
|
142
|
+
for handler in self._handlers:
|
|
143
|
+
handler.setFormatter(self._formatter)
|
|
144
|
+
|
|
145
|
+
def _add_console_handler(self, formatter=None):
|
|
146
|
+
"""
|
|
147
|
+
DESCRIPTION:
|
|
148
|
+
Add console handler to the isolated logger for output to console.
|
|
149
|
+
Note:
|
|
150
|
+
* Only one console handler is added, subsequent calls return the existing handler.
|
|
151
|
+
|
|
152
|
+
PARAMETERS:
|
|
153
|
+
formatter:
|
|
154
|
+
Optional Argument.
|
|
155
|
+
Specifies the logging formatter to use.
|
|
156
|
+
Default Value: None (uses default formatter)
|
|
157
|
+
Types: logging.Formatter
|
|
158
|
+
|
|
159
|
+
RETURNS:
|
|
160
|
+
logging.StreamHandler
|
|
161
|
+
The console handler that was added.
|
|
162
|
+
|
|
163
|
+
RAISES:
|
|
164
|
+
None
|
|
165
|
+
|
|
166
|
+
EXAMPLES:
|
|
167
|
+
>>> logger = _TeradataMlLogger()
|
|
168
|
+
>>> handler = logger._add_console_handler()
|
|
169
|
+
>>> custom_formatter = logging.Formatter('%(message)s')
|
|
170
|
+
>>> handler = logger.add_console_handler(custom_formatter)
|
|
171
|
+
"""
|
|
172
|
+
# Check if console handler already exists
|
|
173
|
+
for handler in self._handlers:
|
|
174
|
+
if isinstance(handler, logging.StreamHandler) and not isinstance(handler, logging.FileHandler):
|
|
175
|
+
return handler # Console handler already exists
|
|
176
|
+
|
|
177
|
+
if formatter is None:
|
|
178
|
+
formatter = self._formatter
|
|
179
|
+
|
|
180
|
+
handler = logging.StreamHandler(sys.stdout)
|
|
181
|
+
handler.setFormatter(formatter)
|
|
182
|
+
handler.setLevel(self._current_level)
|
|
183
|
+
|
|
184
|
+
self._logger.addHandler(handler)
|
|
185
|
+
self._handlers.append(handler)
|
|
186
|
+
return handler
|
|
187
|
+
|
|
188
|
+
def _add_file_handler(self, file_path, formatter=None):
|
|
189
|
+
"""
|
|
190
|
+
DESCRIPTION:
|
|
191
|
+
Add file handler to the isolated logger for output to file.
|
|
192
|
+
Note:
|
|
193
|
+
* Only one file handler is added, subsequent calls return the existing handler.
|
|
194
|
+
|
|
195
|
+
PARAMETERS:
|
|
196
|
+
file_path:
|
|
197
|
+
Required Argument.
|
|
198
|
+
Specifies the path to the log file.
|
|
199
|
+
Types: str
|
|
200
|
+
|
|
201
|
+
formatter:
|
|
202
|
+
Optional Argument.
|
|
203
|
+
Specifies the logging formatter to use.
|
|
204
|
+
Default Value: None (uses default formatter)
|
|
205
|
+
Types: logging.Formatter
|
|
206
|
+
|
|
207
|
+
RETURNS:
|
|
208
|
+
logging.FileHandler
|
|
209
|
+
The file handler that was added.
|
|
210
|
+
|
|
211
|
+
RAISES:
|
|
212
|
+
None
|
|
213
|
+
|
|
214
|
+
EXAMPLES:
|
|
215
|
+
>>> logger = _TeradataMlLogger()
|
|
216
|
+
>>> handler = logger._add_file_handler("app.log")
|
|
217
|
+
>>> custom_formatter = logging.Formatter('%(message)s')
|
|
218
|
+
>>> handler = logger._add_file_handler("app.log", custom_formatter)
|
|
219
|
+
"""
|
|
220
|
+
# Check if file handler for this path already exists
|
|
221
|
+
# Use normcase for Windows case-insensitive path comparison
|
|
222
|
+
normalized_target_path = os.path.normcase(os.path.abspath(file_path))
|
|
223
|
+
for handler in self._handlers:
|
|
224
|
+
if isinstance(handler, logging.FileHandler):
|
|
225
|
+
normalized_handler_path = os.path.normcase(handler.baseFilename)
|
|
226
|
+
if normalized_handler_path == normalized_target_path:
|
|
227
|
+
return handler # File handler for this path already exists
|
|
228
|
+
|
|
229
|
+
if formatter is None:
|
|
230
|
+
formatter = self._formatter
|
|
231
|
+
|
|
232
|
+
handler = logging.FileHandler(file_path)
|
|
233
|
+
handler.setFormatter(formatter)
|
|
234
|
+
handler.setLevel(self._current_level)
|
|
235
|
+
|
|
236
|
+
self._logger.addHandler(handler)
|
|
237
|
+
self._handlers.append(handler)
|
|
238
|
+
return handler
|
|
239
|
+
|
|
240
|
+
def _add_external_handler(self, handler):
|
|
241
|
+
"""
|
|
242
|
+
DESCRIPTION:
|
|
243
|
+
Add an external handler to the isolated logger.
|
|
244
|
+
|
|
245
|
+
PARAMETERS:
|
|
246
|
+
handler:
|
|
247
|
+
Required Argument.
|
|
248
|
+
Specifies the external logging handler to add.
|
|
249
|
+
Types: logging.Handler
|
|
250
|
+
|
|
251
|
+
RETURNS:
|
|
252
|
+
logging.Handler
|
|
253
|
+
The handler that was added.
|
|
254
|
+
|
|
255
|
+
RAISES:
|
|
256
|
+
None
|
|
257
|
+
|
|
258
|
+
EXAMPLES:
|
|
259
|
+
>>> logger = _TeradataMlLogger()
|
|
260
|
+
>>> external_handler = logging.FileHandler("external.log")
|
|
261
|
+
>>> handler = logger._add_external_handler(external_handler)
|
|
262
|
+
"""
|
|
263
|
+
# Only set the level if the handler doesn't already have one
|
|
264
|
+
if handler.level == 0:
|
|
265
|
+
handler.setLevel(self._current_level)
|
|
266
|
+
|
|
267
|
+
self._logger.addHandler(handler)
|
|
268
|
+
self._handlers.append(handler)
|
|
269
|
+
return handler
|
|
270
|
+
|
|
271
|
+
def __getattr__(self, name):
|
|
272
|
+
"""
|
|
273
|
+
DESCRIPTION:
|
|
274
|
+
Dynamically access logging methods (info, debug, warning, error, exception, prf_time).
|
|
275
|
+
|
|
276
|
+
PARAMETERS:
|
|
277
|
+
name:
|
|
278
|
+
Required Argument.
|
|
279
|
+
Specifies the name of the attribute being accessed.
|
|
280
|
+
Types: str
|
|
281
|
+
|
|
282
|
+
RETURNS:
|
|
283
|
+
function
|
|
284
|
+
The logging method corresponding to the name.
|
|
285
|
+
|
|
286
|
+
RAISES:
|
|
287
|
+
AttributeError
|
|
288
|
+
If the attribute name is not a recognized logging method.
|
|
289
|
+
|
|
290
|
+
EXAMPLES:
|
|
291
|
+
>>> logger = _TeradataMlLogger()
|
|
292
|
+
>>> logger.info("Info message")
|
|
293
|
+
>>> logger.debug("Debug message")
|
|
294
|
+
>>> logger.warning("Warning message")
|
|
295
|
+
>>> logger.error("Error message")
|
|
296
|
+
>>> logger.exception("Exception message")
|
|
297
|
+
>>> logger.prf_time("Performance timing message")
|
|
298
|
+
"""
|
|
299
|
+
|
|
300
|
+
if name in _LOG_METHODS:
|
|
301
|
+
def log_method(message, *args, **kwargs):
|
|
302
|
+
"""
|
|
303
|
+
DESCRIPTION:
|
|
304
|
+
Log a message with the specified logging level.
|
|
305
|
+
|
|
306
|
+
PARAMETERS:
|
|
307
|
+
message:
|
|
308
|
+
Required Argument.
|
|
309
|
+
Specifies the message to log.
|
|
310
|
+
Types: str
|
|
311
|
+
|
|
312
|
+
*args:
|
|
313
|
+
Optional Arguments.
|
|
314
|
+
Specifies additional positional arguments for message formatting.
|
|
315
|
+
Types: Any
|
|
316
|
+
|
|
317
|
+
**kwargs:
|
|
318
|
+
Optional Arguments.
|
|
319
|
+
Specifies additional keyword arguments for logging.
|
|
320
|
+
Types: Any
|
|
321
|
+
|
|
322
|
+
RETURNS:
|
|
323
|
+
None
|
|
324
|
+
|
|
325
|
+
RAISES:
|
|
326
|
+
None
|
|
327
|
+
"""
|
|
328
|
+
return getattr(self._logger, name)(message, *args, **kwargs)
|
|
329
|
+
return log_method
|
|
330
|
+
|
|
331
|
+
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
|
|
332
|
+
|
|
333
|
+
def prf_time(self, message, *args, **kwargs):
|
|
334
|
+
"""
|
|
335
|
+
DESCRIPTION:
|
|
336
|
+
Log performance timing message using standard DEBUG level.
|
|
337
|
+
|
|
338
|
+
PARAMETERS:
|
|
339
|
+
message:
|
|
340
|
+
Required Argument.
|
|
341
|
+
Specifies the performance timing message to log.
|
|
342
|
+
Types: str
|
|
343
|
+
|
|
344
|
+
*args:
|
|
345
|
+
Optional Arguments.
|
|
346
|
+
Specifies additional positional arguments for message formatting.
|
|
347
|
+
Types: Any
|
|
348
|
+
|
|
349
|
+
**kwargs:
|
|
350
|
+
Optional Arguments.
|
|
351
|
+
Specifies additional keyword arguments for logging.
|
|
352
|
+
Types: Any
|
|
353
|
+
|
|
354
|
+
RETURNS:
|
|
355
|
+
None
|
|
356
|
+
|
|
357
|
+
RAISES:
|
|
358
|
+
None
|
|
359
|
+
|
|
360
|
+
EXAMPLES:
|
|
361
|
+
>>> logger = _TeradataMlLogger()
|
|
362
|
+
>>> logger.prf_time("Operation completed in 2.5 seconds")
|
|
363
|
+
>>> logger.prf_time("Method %s took %f seconds", method_name, elapsed_time)
|
|
364
|
+
"""
|
|
365
|
+
# Validate argument types
|
|
366
|
+
argument_validation_params = []
|
|
367
|
+
argument_validation_params.append(['message', message, True, str, True])
|
|
368
|
+
_Validators._validate_function_arguments(argument_validation_params)
|
|
369
|
+
|
|
370
|
+
# Only log if PRF_TIME flag is enabled
|
|
371
|
+
if self._prf_time:
|
|
372
|
+
self._logger.debug(f"PRF_TIME | {message}", *args, **kwargs)
|
|
373
|
+
|
|
374
|
+
def _is_enabled_for_level(self, level_name):
|
|
375
|
+
"""
|
|
376
|
+
DESCRIPTION:
|
|
377
|
+
Check if logging is enabled for the given level name.
|
|
378
|
+
|
|
379
|
+
PARAMETERS:
|
|
380
|
+
level_name:
|
|
381
|
+
Required Argument.
|
|
382
|
+
Specifies the logging level name to check.
|
|
383
|
+
Permitted Values: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'PRF_TIME'
|
|
384
|
+
Types: str
|
|
385
|
+
|
|
386
|
+
RETURNS:
|
|
387
|
+
bool
|
|
388
|
+
True if logging is enabled for the level, False otherwise.
|
|
389
|
+
|
|
390
|
+
RAISES:
|
|
391
|
+
None
|
|
392
|
+
|
|
393
|
+
EXAMPLES:
|
|
394
|
+
>>> logger = _TeradataMlLogger()
|
|
395
|
+
>>> if logger._is_enabled_for_level('DEBUG'):
|
|
396
|
+
... logger.debug("Debug message")
|
|
397
|
+
>>> enabled = logger._is_enabled_for_level('PRF_TIME')
|
|
398
|
+
"""
|
|
399
|
+
if level_name == 'PRF_TIME':
|
|
400
|
+
return self._prf_time
|
|
401
|
+
level_num = LoggingLevel.level_map.value.get(level_name, logging.INFO)
|
|
402
|
+
return self._current_level <= level_num
|
|
403
|
+
|
|
404
|
+
def remove_handlers(self, handler_type=None):
|
|
405
|
+
"""
|
|
406
|
+
DESCRIPTION:
|
|
407
|
+
Remove specific types of handlers or all handlers from the logger.
|
|
408
|
+
|
|
409
|
+
PARAMETERS:
|
|
410
|
+
handler_type:
|
|
411
|
+
Optional Argument.
|
|
412
|
+
Specifies the type of handler to remove. If None, removes all handlers.
|
|
413
|
+
Default Value: None
|
|
414
|
+
Permitted Values: 'console', 'file', a specific handler class or type
|
|
415
|
+
Types: str or type of logging.Handler
|
|
416
|
+
|
|
417
|
+
RETURNS:
|
|
418
|
+
None
|
|
419
|
+
|
|
420
|
+
RAISES:
|
|
421
|
+
None
|
|
422
|
+
|
|
423
|
+
EXAMPLES:
|
|
424
|
+
>>> logger = _TeradataMlLogger()
|
|
425
|
+
>>> logger.remove_handlers('console') # Remove only console handlers
|
|
426
|
+
>>> logger.remove_handlers('file') # Remove only file handlers
|
|
427
|
+
>>> logger.remove_handlers() # Remove all handlers
|
|
428
|
+
>>> logger.remove_handlers(RotatingFileHandler) # Remove specific type
|
|
429
|
+
"""
|
|
430
|
+
for handler in self._handlers[:]:
|
|
431
|
+
remove = False
|
|
432
|
+
|
|
433
|
+
if handler_type is None:
|
|
434
|
+
remove = True
|
|
435
|
+
elif handler_type == 'console':
|
|
436
|
+
remove = isinstance(handler, logging.StreamHandler) and not isinstance(handler, logging.FileHandler)
|
|
437
|
+
elif handler_type == 'file':
|
|
438
|
+
remove = isinstance(handler, logging.FileHandler)
|
|
439
|
+
elif isinstance(handler_type, type):
|
|
440
|
+
remove = isinstance(handler, handler_type)
|
|
441
|
+
elif isinstance(handler_type, str):
|
|
442
|
+
remove = handler_type.lower() in handler.__class__.__name__.lower()
|
|
443
|
+
|
|
444
|
+
if remove:
|
|
445
|
+
if isinstance(handler, logging.FileHandler):
|
|
446
|
+
handler.close()
|
|
447
|
+
self._logger.removeHandler(handler)
|
|
448
|
+
self._handlers.remove(handler)
|
|
449
|
+
|
|
450
|
+
# Clear all handlers lists if removing all
|
|
451
|
+
if handler_type is None:
|
|
452
|
+
self._logger.handlers.clear()
|
|
453
|
+
|
|
454
|
+
class _ExternalLoggerWrapper:
|
|
455
|
+
"""
|
|
456
|
+
Wrapper for external logger that provides the same interface as _TeradataMlLogger.
|
|
457
|
+
"""
|
|
458
|
+
|
|
459
|
+
def __init__(self, external_logger, prf_time=False):
|
|
460
|
+
"""
|
|
461
|
+
DESCRIPTION:
|
|
462
|
+
Initialize wrapper with external logger instance.
|
|
463
|
+
|
|
464
|
+
PARAMETERS:
|
|
465
|
+
external_logger:
|
|
466
|
+
Required Argument.
|
|
467
|
+
Specifies the external logger to wrap.
|
|
468
|
+
Types: logging.Logger
|
|
469
|
+
|
|
470
|
+
prf_time:
|
|
471
|
+
Optional Argument.
|
|
472
|
+
Specifies whether PRF_TIME logging is enabled.
|
|
473
|
+
Default Value: False
|
|
474
|
+
Types: bool
|
|
475
|
+
|
|
476
|
+
RETURNS:
|
|
477
|
+
None
|
|
478
|
+
|
|
479
|
+
RAISES:
|
|
480
|
+
None
|
|
481
|
+
|
|
482
|
+
EXAMPLES:
|
|
483
|
+
>>> import logging
|
|
484
|
+
>>> external_logger = logging.getLogger("external")
|
|
485
|
+
>>> wrapper = _ExternalLoggerWrapper(external_logger, True)
|
|
486
|
+
"""
|
|
487
|
+
# Validate argument types
|
|
488
|
+
argument_validation_params = []
|
|
489
|
+
argument_validation_params.append(['external_logger', external_logger, True, logging.Logger, True])
|
|
490
|
+
argument_validation_params.append(['prf_time', prf_time, False, bool, True])
|
|
491
|
+
_Validators._validate_function_arguments(argument_validation_params)
|
|
492
|
+
|
|
493
|
+
self._external_logger = external_logger
|
|
494
|
+
self._handlers = [] # Track handlers we add
|
|
495
|
+
self._prf_time = prf_time
|
|
496
|
+
|
|
497
|
+
def __getattr__(self, name):
|
|
498
|
+
if name in _LOG_METHODS:
|
|
499
|
+
def log_method(message, *args, **kwargs):
|
|
500
|
+
return getattr(self._external_logger, name)(message, *args, **kwargs)
|
|
501
|
+
return log_method
|
|
502
|
+
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
|
|
503
|
+
|
|
504
|
+
def prf_time(self, message, *args, **kwargs):
|
|
505
|
+
"""
|
|
506
|
+
DESCRIPTION:
|
|
507
|
+
Log performance timing message via external logger using DEBUG level.
|
|
508
|
+
|
|
509
|
+
PARAMETERS:
|
|
510
|
+
message:
|
|
511
|
+
Required Argument.
|
|
512
|
+
Specifies the performance timing message to log.
|
|
513
|
+
Types: str
|
|
514
|
+
|
|
515
|
+
*args:
|
|
516
|
+
Optional Arguments.
|
|
517
|
+
Specifies additional positional arguments for message formatting.
|
|
518
|
+
Types: Any
|
|
519
|
+
|
|
520
|
+
**kwargs:
|
|
521
|
+
Optional Arguments.
|
|
522
|
+
Specifies additional keyword arguments for logging.
|
|
523
|
+
Types: Any
|
|
524
|
+
|
|
525
|
+
RETURNS:
|
|
526
|
+
None
|
|
527
|
+
|
|
528
|
+
RAISES:
|
|
529
|
+
None
|
|
530
|
+
|
|
531
|
+
EXAMPLES:
|
|
532
|
+
>>> wrapper = _ExternalLoggerWrapper(external_logger)
|
|
533
|
+
>>> wrapper.prf_time("Operation took 1.5 seconds")
|
|
534
|
+
"""
|
|
535
|
+
# Validate argument types
|
|
536
|
+
argument_validation_params = []
|
|
537
|
+
argument_validation_params.append(['message', message, True, str, True])
|
|
538
|
+
_Validators._validate_function_arguments(argument_validation_params)
|
|
539
|
+
|
|
540
|
+
# Only log if PRF_TIME flag is enabled
|
|
541
|
+
if self._prf_time:
|
|
542
|
+
self._external_logger.debug(f"PRF_TIME | {message}", *args, **kwargs)
|
|
543
|
+
|
|
544
|
+
def _is_enabled_for_level(self, level_name):
|
|
545
|
+
"""
|
|
546
|
+
DESCRIPTION:
|
|
547
|
+
Check if logging is enabled for the given level via external logger.
|
|
548
|
+
|
|
549
|
+
PARAMETERS:
|
|
550
|
+
level_name:
|
|
551
|
+
Required Argument.
|
|
552
|
+
Specifies the logging level name to check.
|
|
553
|
+
Permitted Values: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'PRF_TIME'
|
|
554
|
+
Types: str
|
|
555
|
+
|
|
556
|
+
RETURNS:
|
|
557
|
+
bool
|
|
558
|
+
True if logging is enabled for the level, False otherwise.
|
|
559
|
+
|
|
560
|
+
RAISES:
|
|
561
|
+
None
|
|
562
|
+
|
|
563
|
+
EXAMPLES:
|
|
564
|
+
>>> wrapper = _ExternalLoggerWrapper(external_logger)
|
|
565
|
+
>>> enabled = wrapper._is_enabled_for_level('DEBUG')
|
|
566
|
+
"""
|
|
567
|
+
# Validate argument type
|
|
568
|
+
argument_validation_params = []
|
|
569
|
+
argument_validation_params.append(['level_name', level_name, True, str, True, ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'PRF_TIME']])
|
|
570
|
+
_Validators._validate_function_arguments(argument_validation_params)
|
|
571
|
+
|
|
572
|
+
if level_name == 'PRF_TIME':
|
|
573
|
+
return self._prf_time
|
|
574
|
+
|
|
575
|
+
level_num = LoggingLevel.level_map.value.get(level_name, logging.INFO)
|
|
576
|
+
return self._external_logger.isEnabledFor(level_num)
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
class TDLogLevel:
|
|
580
|
+
"""
|
|
581
|
+
Internal class to define log levels for TeradataML.
|
|
582
|
+
"""
|
|
583
|
+
NONE = "NONE"
|
|
584
|
+
INFO = "INFO"
|
|
585
|
+
DEBUG = "DEBUG"
|
|
586
|
+
PRF_TIME = "PRF_TIME"
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
class _NullLogger:
|
|
590
|
+
"""
|
|
591
|
+
Null logger implementation for NONE level providing zero overhead.
|
|
592
|
+
"""
|
|
593
|
+
|
|
594
|
+
def __getattr__(self, name):
|
|
595
|
+
"""
|
|
596
|
+
DESCRIPTION:
|
|
597
|
+
Dynamically provide no-operation methods for logging methods.
|
|
598
|
+
|
|
599
|
+
PARAMETERS:
|
|
600
|
+
name:
|
|
601
|
+
Required Argument.
|
|
602
|
+
Specifies the name of the attribute being accessed.
|
|
603
|
+
Types: str
|
|
604
|
+
|
|
605
|
+
RETURNS:
|
|
606
|
+
function
|
|
607
|
+
A no-operation function for logging methods.
|
|
608
|
+
|
|
609
|
+
RAISES:
|
|
610
|
+
AttributeError
|
|
611
|
+
If the attribute name is not a recognized logging method.
|
|
612
|
+
|
|
613
|
+
EXAMPLES:
|
|
614
|
+
>>> null_logger = _NullLogger()
|
|
615
|
+
>>> null_logger.info("This message is ignored")
|
|
616
|
+
>>> null_logger.debug("This debug message is ignored")
|
|
617
|
+
"""
|
|
618
|
+
if name in _LOG_METHODS:
|
|
619
|
+
def noop(*args, **kwargs):
|
|
620
|
+
pass
|
|
621
|
+
return noop
|
|
622
|
+
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
|
|
623
|
+
|
|
624
|
+
def prf_time(self, message, *args, **kwargs):
|
|
625
|
+
"""
|
|
626
|
+
DESCRIPTION:
|
|
627
|
+
No-operation method for performance timing logging (ignored).
|
|
628
|
+
|
|
629
|
+
PARAMETERS:
|
|
630
|
+
message:
|
|
631
|
+
Required Argument.
|
|
632
|
+
Specifies the performance timing message to log (ignored).
|
|
633
|
+
Types: str
|
|
634
|
+
|
|
635
|
+
*args:
|
|
636
|
+
Optional Arguments.
|
|
637
|
+
Specifies additional positional arguments (ignored).
|
|
638
|
+
Types: Any
|
|
639
|
+
|
|
640
|
+
**kwargs:
|
|
641
|
+
Optional Arguments.
|
|
642
|
+
Specifies additional keyword arguments (ignored).
|
|
643
|
+
Types: Any
|
|
644
|
+
|
|
645
|
+
RETURNS:
|
|
646
|
+
None
|
|
647
|
+
|
|
648
|
+
RAISES:
|
|
649
|
+
None
|
|
650
|
+
|
|
651
|
+
EXAMPLES:
|
|
652
|
+
>>> null_logger = _NullLogger()
|
|
653
|
+
>>> null_logger.prf_time("This performance timing message is ignored")
|
|
654
|
+
"""
|
|
655
|
+
pass
|
|
656
|
+
|
|
657
|
+
def _is_enabled_for_level(self, level_name):
|
|
658
|
+
"""
|
|
659
|
+
DESCRIPTION:
|
|
660
|
+
Check if logging is enabled for the given level (always False for null logger).
|
|
661
|
+
|
|
662
|
+
PARAMETERS:
|
|
663
|
+
level_name:
|
|
664
|
+
Required Argument.
|
|
665
|
+
Specifies the logging level name to check (ignored).
|
|
666
|
+
Permitted Values: 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'PRF_TIME'
|
|
667
|
+
Types: str
|
|
668
|
+
|
|
669
|
+
RETURNS:
|
|
670
|
+
bool
|
|
671
|
+
Always returns False for null logger.
|
|
672
|
+
|
|
673
|
+
RAISES:
|
|
674
|
+
None
|
|
675
|
+
|
|
676
|
+
EXAMPLES:
|
|
677
|
+
>>> null_logger = _NullLogger()
|
|
678
|
+
>>> enabled = null_logger._is_enabled_for_level('DEBUG') # Returns False
|
|
679
|
+
"""
|
|
680
|
+
return False
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
class TeradataMlLogger:
|
|
684
|
+
"""
|
|
685
|
+
Session-level logger manager for teradataml with performance timing capabilities.
|
|
686
|
+
"""
|
|
687
|
+
# Singleton instance and initialization flag for TeradataMlLogger
|
|
688
|
+
_instance = None
|
|
689
|
+
# Flag to indicate if the logger has been initialized to prevent multiple initializations
|
|
690
|
+
_initialized = False
|
|
691
|
+
# Current log level for the TeradataMlLogger instance
|
|
692
|
+
_level = TDLogLevel.NONE
|
|
693
|
+
# Internal logger instance for teradataml logging
|
|
694
|
+
_teradata_logger = None
|
|
695
|
+
# External logger instance for integration with external logging systems
|
|
696
|
+
_external_logger = None
|
|
697
|
+
# Performance timing flag to indicate if performance timing logging is enabled
|
|
698
|
+
_prf_time_flag = False
|
|
699
|
+
|
|
700
|
+
def __new__(cls, cls_to_wrap=None):
|
|
701
|
+
"""
|
|
702
|
+
DESCRIPTION:
|
|
703
|
+
Create or return singleton instance, or perform class decoration.
|
|
704
|
+
|
|
705
|
+
PARAMETERS:
|
|
706
|
+
cls_to_wrap:
|
|
707
|
+
Optional Argument.
|
|
708
|
+
Specifies the class to wrap with logging decoration.
|
|
709
|
+
Default Value: None
|
|
710
|
+
Types: type
|
|
711
|
+
|
|
712
|
+
RETURNS:
|
|
713
|
+
TeradataMlLogger or decorated class
|
|
714
|
+
Returns singleton instance or decorated class if cls_to_wrap provided.
|
|
715
|
+
|
|
716
|
+
RAISES:
|
|
717
|
+
None
|
|
718
|
+
|
|
719
|
+
EXAMPLES:
|
|
720
|
+
# Example 1: Normal singleton instantiation (without decorator)
|
|
721
|
+
>>> from teradataml.common.logger import TeradataMlLogger, TDLogLevel, get_td_logger
|
|
722
|
+
>>> TeradataMlLogger.init(level=TDLogLevel.INFO)
|
|
723
|
+
>>> logger_instance = TeradataMlLogger()
|
|
724
|
+
>>> logger = logger_instance.get_logger()
|
|
725
|
+
>>> logger.info("This is a test message")
|
|
726
|
+
2025-09-23 11:27:52,976 | INFO | This is a test message
|
|
727
|
+
|
|
728
|
+
# Example 2: Using as decorator
|
|
729
|
+
>>> @TeradataMlLogger
|
|
730
|
+
... class DataProcessor:
|
|
731
|
+
... def __init__(self, name):
|
|
732
|
+
... self.name = name
|
|
733
|
+
... # self._logger is automatically available
|
|
734
|
+
...
|
|
735
|
+
... def process_data(self, data):
|
|
736
|
+
... self._logger.info(f"Processing {len(data)} items")
|
|
737
|
+
... return [x * 2 for x in data]
|
|
738
|
+
>>> TeradataMlLogger.init(level=TDLogLevel.PRF_TIME)
|
|
739
|
+
>>> processor = DataProcessor("test")
|
|
740
|
+
>>> result = processor.process_data([1, 2, 3])
|
|
741
|
+
2025-09-23 11:31:24,389 | INFO | PRF_TIME | Started DataProcessor.__init__
|
|
742
|
+
2025-09-23 11:31:24,389 | INFO | PRF_TIME | Completed DataProcessor.__init__ in 0.00000 secs
|
|
743
|
+
2025-09-23 11:31:24,389 | INFO | PRF_TIME | Started DataProcessor.process_data
|
|
744
|
+
2025-09-23 11:31:24,389 | INFO | Processing 3 items
|
|
745
|
+
2025-09-23 11:31:24,389 | INFO | PRF_TIME | Completed DataProcessor.process_data in 0.00053 secs
|
|
746
|
+
|
|
747
|
+
# Example 3: Using as decorator with debug logging
|
|
748
|
+
>>> @TeradataMlLogger
|
|
749
|
+
... class Calculator:
|
|
750
|
+
... def __init__(self):
|
|
751
|
+
... self._logger.info("Calculator initialized")
|
|
752
|
+
... pass
|
|
753
|
+
...
|
|
754
|
+
... def add(self, a, b):
|
|
755
|
+
... self._logger.debug(f"Adding {a} + {b}")
|
|
756
|
+
... return a + b
|
|
757
|
+
>>> TeradataMlLogger.init(level=TDLogLevel.DEBUG)
|
|
758
|
+
>>> calc = Calculator()
|
|
759
|
+
>>> result = calc.add(5, 3)
|
|
760
|
+
2025-09-23 11:35:47,674 | INFO | Calculator initialized
|
|
761
|
+
2025-09-23 11:35:47,675 | DEBUG | Adding 5 + 3
|
|
762
|
+
|
|
763
|
+
# Example 4: Without decorator - manual logger usage
|
|
764
|
+
>>> class SimpleClass:
|
|
765
|
+
... def __init__(self):
|
|
766
|
+
... self.logger = get_td_logger()
|
|
767
|
+
...
|
|
768
|
+
... def do_work(self):
|
|
769
|
+
... self.logger.info("Doing some work")
|
|
770
|
+
>>> TeradataMlLogger.init(level=TDLogLevel.INFO)
|
|
771
|
+
>>> obj = SimpleClass()
|
|
772
|
+
>>> obj.do_work()
|
|
773
|
+
2025-09-23 11:44:21,840 | INFO | Doing some work
|
|
774
|
+
"""
|
|
775
|
+
# If called with a class (decorator usage), perform decoration
|
|
776
|
+
if cls_to_wrap is not None and isinstance(cls_to_wrap, type):
|
|
777
|
+
return cls.decorate(cls_to_wrap)
|
|
778
|
+
|
|
779
|
+
# Normal singleton instantiation
|
|
780
|
+
if cls._instance is None:
|
|
781
|
+
cls._instance = super(TeradataMlLogger, cls).__new__(cls)
|
|
782
|
+
return cls._instance
|
|
783
|
+
|
|
784
|
+
@classmethod
|
|
785
|
+
def init(cls,
|
|
786
|
+
name="teradataml_logger",
|
|
787
|
+
level=TDLogLevel.NONE,
|
|
788
|
+
logger=None,
|
|
789
|
+
log_file=None):
|
|
790
|
+
"""
|
|
791
|
+
DESCRIPTION:
|
|
792
|
+
Initialize the teradataml session logger. If already initialized, reset and reinitialize.
|
|
793
|
+
Note:
|
|
794
|
+
* If level is NONE, uses null logger for zero overhead.
|
|
795
|
+
* If external logger is provided, uses it directly instead of copying handlers.
|
|
796
|
+
* If log_file is specified, logs to file in ~/.teradataml/logs directory.
|
|
797
|
+
* If no log_file and no external logger, logs to console by default.
|
|
798
|
+
* Performance timing logging is enabled only if level is PRF_TIME.
|
|
799
|
+
* By default, it uses console handler with '%(asctime)s | %(levelname)-8s | %(message)s' format.
|
|
800
|
+
|
|
801
|
+
PARAMETERS:
|
|
802
|
+
name:
|
|
803
|
+
Optional Argument.
|
|
804
|
+
Specifies the name of the logger instance.
|
|
805
|
+
Default Value: 'teradataml_logger'
|
|
806
|
+
Types: str
|
|
807
|
+
|
|
808
|
+
level:
|
|
809
|
+
Optional Argument.
|
|
810
|
+
Specifies the log level to set.
|
|
811
|
+
Default Value: TDLogLevel.NONE
|
|
812
|
+
Permitted Values:
|
|
813
|
+
* TDLogLevel.NONE : 'NONE' no logging, zero overhead
|
|
814
|
+
* TDLogLevel.INFO : 'INFO' standard logging
|
|
815
|
+
* TDLogLevel.DEBUG : 'DEBUG' detailed logging
|
|
816
|
+
* TDLogLevel.PRF_TIME : 'PRF_TIME' logging with performance timing enabled
|
|
817
|
+
Types: str
|
|
818
|
+
|
|
819
|
+
logger:
|
|
820
|
+
Optional Argument.
|
|
821
|
+
Specifies external logger to use for integration.
|
|
822
|
+
Default Value: None
|
|
823
|
+
Types: logging.Logger
|
|
824
|
+
|
|
825
|
+
log_file:
|
|
826
|
+
Optional Argument.
|
|
827
|
+
Specifies file name for log file.
|
|
828
|
+
Default Value: None
|
|
829
|
+
Types: str
|
|
830
|
+
|
|
831
|
+
RETURNS:
|
|
832
|
+
None
|
|
833
|
+
|
|
834
|
+
RAISES:
|
|
835
|
+
ValueError
|
|
836
|
+
If invalid log level is provided.
|
|
837
|
+
|
|
838
|
+
EXAMPLES:
|
|
839
|
+
>>> TeradataMlLogger.init()
|
|
840
|
+
>>> TeradataMlLogger.init(level='DEBUG')
|
|
841
|
+
>>> TeradataMlLogger.init(level='INFO', log_file='app.log')
|
|
842
|
+
>>> TeradataMlLogger.init(level='PRF_TIME')
|
|
843
|
+
>>> import logging
|
|
844
|
+
>>> external_logger = logging.getLogger('external')
|
|
845
|
+
>>> TeradataMlLogger.init(logger=external_logger)
|
|
846
|
+
"""
|
|
847
|
+
argument_validation_params = []
|
|
848
|
+
argument_validation_params.append(['name', name, False, str, True])
|
|
849
|
+
argument_validation_params.append(['level', level, False, str, True, ['NONE', 'INFO', 'DEBUG', 'PRF_TIME']])
|
|
850
|
+
argument_validation_params.append(['logger', logger, True, logging.Logger, True])
|
|
851
|
+
argument_validation_params.append(['log_file', log_file, True, str, True])
|
|
852
|
+
|
|
853
|
+
# Validate argument types
|
|
854
|
+
_Validators._validate_function_arguments(argument_validation_params)
|
|
855
|
+
|
|
856
|
+
# If already initialized, reset first
|
|
857
|
+
if cls._initialized:
|
|
858
|
+
cls.reset()
|
|
859
|
+
|
|
860
|
+
cls._level = level
|
|
861
|
+
cls._external_logger = logger
|
|
862
|
+
cls._initialized = True
|
|
863
|
+
|
|
864
|
+
# Set PRF_TIME flag for conditional wrapper
|
|
865
|
+
cls._prf_time_flag = (level == TDLogLevel.PRF_TIME)
|
|
866
|
+
|
|
867
|
+
# If external logger provided, use it directly instead of copying handlers
|
|
868
|
+
if cls._external_logger is not None:
|
|
869
|
+
# Create a wrapper that uses the external logger directly
|
|
870
|
+
# This avoids confusion between internal and external logger instances
|
|
871
|
+
cls._teradata_logger = _ExternalLoggerWrapper(cls._external_logger, cls._prf_time_flag)
|
|
872
|
+
else:
|
|
873
|
+
|
|
874
|
+
# If level is NONE, use null logger for zero overhead
|
|
875
|
+
if level == TDLogLevel.NONE:
|
|
876
|
+
cls._teradata_logger = _NullLogger()
|
|
877
|
+
return
|
|
878
|
+
|
|
879
|
+
# Create our isolated teradataml logger
|
|
880
|
+
level_map = {
|
|
881
|
+
TDLogLevel.INFO: logging.INFO,
|
|
882
|
+
TDLogLevel.DEBUG: logging.DEBUG,
|
|
883
|
+
TDLogLevel.PRF_TIME: logging.DEBUG
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
effective_level = level_map[level]
|
|
887
|
+
cls._teradata_logger = _TeradataMlLogger(name, effective_level, cls._prf_time_flag)
|
|
888
|
+
|
|
889
|
+
# Add file handler if specified
|
|
890
|
+
if log_file is not None:
|
|
891
|
+
# Use default ~/.teradataml/logs directory
|
|
892
|
+
home_dir = os.path.expanduser("~")
|
|
893
|
+
log_dir = os.path.join(home_dir, ".teradataml", "logs")
|
|
894
|
+
os.makedirs(log_dir, exist_ok=True)
|
|
895
|
+
|
|
896
|
+
file_path = os.path.join(log_dir, log_file)
|
|
897
|
+
cls._teradata_logger._add_file_handler(file_path)
|
|
898
|
+
else:
|
|
899
|
+
# Add console handler only if no file handler is specified and no external logger
|
|
900
|
+
if cls._external_logger is None:
|
|
901
|
+
cls._teradata_logger._add_console_handler()
|
|
902
|
+
|
|
903
|
+
@classmethod
|
|
904
|
+
def get_logger(cls):
|
|
905
|
+
"""
|
|
906
|
+
DESCRIPTION:
|
|
907
|
+
Get the teradataml logger instance.
|
|
908
|
+
|
|
909
|
+
PARAMETERS:
|
|
910
|
+
None
|
|
911
|
+
|
|
912
|
+
RETURNS:
|
|
913
|
+
_TeradataMlLogger or _NullLogger
|
|
914
|
+
The teradataml logger instance or null logger if NONE level.
|
|
915
|
+
|
|
916
|
+
RAISES:
|
|
917
|
+
None
|
|
918
|
+
|
|
919
|
+
EXAMPLES:
|
|
920
|
+
>>> logger = TeradataMlLogger.get_logger()
|
|
921
|
+
>>> logger.info("Some message")
|
|
922
|
+
"""
|
|
923
|
+
if not cls._initialized or cls._level == TDLogLevel.NONE:
|
|
924
|
+
return _NullLogger()
|
|
925
|
+
return cls._teradata_logger
|
|
926
|
+
|
|
927
|
+
@classmethod
|
|
928
|
+
def get_level(cls):
|
|
929
|
+
"""
|
|
930
|
+
DESCRIPTION:
|
|
931
|
+
Get current log level.
|
|
932
|
+
|
|
933
|
+
PARAMETERS:
|
|
934
|
+
None
|
|
935
|
+
|
|
936
|
+
RETURNS:
|
|
937
|
+
str
|
|
938
|
+
The current logging level.
|
|
939
|
+
|
|
940
|
+
RAISES:
|
|
941
|
+
None
|
|
942
|
+
|
|
943
|
+
EXAMPLES:
|
|
944
|
+
>>> level = TeradataMlLogger.get_level()
|
|
945
|
+
>>> print(f"Current level: {level}")
|
|
946
|
+
"""
|
|
947
|
+
return cls._level
|
|
948
|
+
|
|
949
|
+
@classmethod
|
|
950
|
+
def is_performance_enabled(cls):
|
|
951
|
+
"""
|
|
952
|
+
DESCRIPTION:
|
|
953
|
+
Check if performance timing is enabled.
|
|
954
|
+
|
|
955
|
+
PARAMETERS:
|
|
956
|
+
None
|
|
957
|
+
|
|
958
|
+
RETURNS:
|
|
959
|
+
bool
|
|
960
|
+
True if performance timing is enabled, False otherwise.
|
|
961
|
+
|
|
962
|
+
RAISES:
|
|
963
|
+
None
|
|
964
|
+
|
|
965
|
+
EXAMPLES:
|
|
966
|
+
>>> if TeradataMlLogger.is_performance_enabled():
|
|
967
|
+
... print("Performance timing is enabled")
|
|
968
|
+
"""
|
|
969
|
+
return cls._level == TDLogLevel.PRF_TIME
|
|
970
|
+
|
|
971
|
+
@classmethod
|
|
972
|
+
def reset(cls):
|
|
973
|
+
"""
|
|
974
|
+
DESCRIPTION:
|
|
975
|
+
Reset the logger state.
|
|
976
|
+
|
|
977
|
+
PARAMETERS:
|
|
978
|
+
None
|
|
979
|
+
|
|
980
|
+
RETURNS:
|
|
981
|
+
None
|
|
982
|
+
|
|
983
|
+
RAISES:
|
|
984
|
+
None
|
|
985
|
+
|
|
986
|
+
EXAMPLES:
|
|
987
|
+
>>> TeradataMlLogger.reset()
|
|
988
|
+
"""
|
|
989
|
+
if cls._teradata_logger and hasattr(cls._teradata_logger, 'remove_handlers'):
|
|
990
|
+
cls._teradata_logger.remove_handlers()
|
|
991
|
+
|
|
992
|
+
cls._instance = None
|
|
993
|
+
cls._initialized = False
|
|
994
|
+
cls._level = TDLogLevel.NONE
|
|
995
|
+
cls._teradata_logger = None
|
|
996
|
+
cls._external_logger = None
|
|
997
|
+
cls._prf_time_flag = False
|
|
998
|
+
|
|
999
|
+
def __call__(self, cls_to_wrap):
|
|
1000
|
+
"""
|
|
1001
|
+
DESCRIPTION:
|
|
1002
|
+
Allow TeradataMlLogger to be used directly as a class decorator.
|
|
1003
|
+
Always injects an instance attribute _logger = TeradataMlLogger.get_logger().
|
|
1004
|
+
Timing wrappers only activate when session level == TDLogLevel.PRF_TIME.
|
|
1005
|
+
Delegates to TeradataMlLogger.decorate().
|
|
1006
|
+
|
|
1007
|
+
PARAMETERS:
|
|
1008
|
+
cls_to_wrap:
|
|
1009
|
+
Required Argument.
|
|
1010
|
+
Specifies the class to decorate.
|
|
1011
|
+
Types: type
|
|
1012
|
+
|
|
1013
|
+
RETURNS:
|
|
1014
|
+
type
|
|
1015
|
+
The decorated class with method timing.
|
|
1016
|
+
|
|
1017
|
+
RAISES:
|
|
1018
|
+
None
|
|
1019
|
+
|
|
1020
|
+
EXAMPLES:
|
|
1021
|
+
>>> @TeradataMlLogger()
|
|
1022
|
+
... class MyClass:
|
|
1023
|
+
... def method(self):
|
|
1024
|
+
... pass
|
|
1025
|
+
"""
|
|
1026
|
+
return self.__class__.decorate(cls_to_wrap)
|
|
1027
|
+
|
|
1028
|
+
@classmethod
|
|
1029
|
+
def decorate(cls, cls_to_wrap):
|
|
1030
|
+
"""
|
|
1031
|
+
DESCRIPTION:
|
|
1032
|
+
Class decorator that:
|
|
1033
|
+
* Always injects an instance attribute _logger = TeradataMlLogger.get_logger() into each constructed object.
|
|
1034
|
+
* Conditionally (only when session level == TDLogLevel.PRF_TIME) wraps __init__ and all methods defined
|
|
1035
|
+
directly on the class (instance, @classmethod, @staticmethod) with lightweight timing logic that:
|
|
1036
|
+
- Logs "Started <Class>.<method>"
|
|
1037
|
+
- Executes the method
|
|
1038
|
+
- Logs "Completed ..." with elapsed seconds (or "Failed ..." on exception)
|
|
1039
|
+
* When PRF_TIME is NOT enabled, methods execute with effectively zero added overhead.
|
|
1040
|
+
* Automatically logs exceptions (except TeradataMlException) via the session logger while still re-raising them.
|
|
1041
|
+
* Avoids wrapping dunder methods (other than __init__) to keep behavior predictable.
|
|
1042
|
+
|
|
1043
|
+
PARAMETERS:
|
|
1044
|
+
cls_to_wrap:
|
|
1045
|
+
Required Argument.
|
|
1046
|
+
Specifies the class to decorate.
|
|
1047
|
+
Types: type
|
|
1048
|
+
|
|
1049
|
+
RETURNS:
|
|
1050
|
+
type
|
|
1051
|
+
The decorated class with method timing.
|
|
1052
|
+
|
|
1053
|
+
RAISES:
|
|
1054
|
+
None
|
|
1055
|
+
|
|
1056
|
+
EXAMPLES:
|
|
1057
|
+
>>> @TeradataMlLogger.decorate
|
|
1058
|
+
... class MyClass:
|
|
1059
|
+
... def method(self):
|
|
1060
|
+
... pass
|
|
1061
|
+
>>> # Or use as decorator
|
|
1062
|
+
>>> @TeradataMlLogger
|
|
1063
|
+
... class MyClass:
|
|
1064
|
+
... pass
|
|
1065
|
+
"""
|
|
1066
|
+
# ALWAYS inject logger, even if not PRF_TIME level
|
|
1067
|
+
original_init = cls_to_wrap.__init__
|
|
1068
|
+
|
|
1069
|
+
@functools.wraps(original_init)
|
|
1070
|
+
def new_init(self, *args, **kwargs):
|
|
1071
|
+
try:
|
|
1072
|
+
# Only add timing if PRF_TIME is enabled
|
|
1073
|
+
if cls._prf_time_flag:
|
|
1074
|
+
method_signature = f"{cls_to_wrap.__name__}.__init__"
|
|
1075
|
+
self._logger.prf_time(f"Started {method_signature}")
|
|
1076
|
+
start_time = time.perf_counter()
|
|
1077
|
+
|
|
1078
|
+
try:
|
|
1079
|
+
result = original_init(self, *args, **kwargs)
|
|
1080
|
+
elapsed = time.perf_counter() - start_time
|
|
1081
|
+
self._logger.prf_time(f"Completed {method_signature} in {elapsed:.5f} secs")
|
|
1082
|
+
return result
|
|
1083
|
+
except Exception as e:
|
|
1084
|
+
elapsed = time.perf_counter() - start_time
|
|
1085
|
+
self._logger.prf_time(f"Failed {method_signature} in {elapsed:.5f} secs")
|
|
1086
|
+
raise
|
|
1087
|
+
else:
|
|
1088
|
+
# No timing, just call original __init__
|
|
1089
|
+
return original_init(self, *args, **kwargs)
|
|
1090
|
+
except Exception as e:
|
|
1091
|
+
# Automatic exception logging for __init__ method
|
|
1092
|
+
cls._log_exception_helper(e, f"{cls_to_wrap.__name__}.__init__()")
|
|
1093
|
+
# Re-raise the exception to maintain normal behavior
|
|
1094
|
+
raise
|
|
1095
|
+
|
|
1096
|
+
cls_to_wrap.__init__ = new_init
|
|
1097
|
+
|
|
1098
|
+
# Inject a dynamic property only once so every access reflects latest init().
|
|
1099
|
+
if not isinstance(getattr(cls_to_wrap, "_logger", None), property):
|
|
1100
|
+
def _dynamic_logger(self):
|
|
1101
|
+
return TeradataMlLogger.get_logger()
|
|
1102
|
+
cls_to_wrap._logger = property(_dynamic_logger)
|
|
1103
|
+
|
|
1104
|
+
# Use conditional decoration for minimal overhead
|
|
1105
|
+
# Wrap all methods defined in this class (not inherited ones)
|
|
1106
|
+
for attr_name, attr_value in cls_to_wrap.__dict__.items():
|
|
1107
|
+
if not attr_name.startswith('__') and not attr_name.endswith('__'):
|
|
1108
|
+
# Check if it's a method we should wrap
|
|
1109
|
+
if isinstance(attr_value, staticmethod):
|
|
1110
|
+
wrapped = cls._create_conditional_method_wrapper(attr_value.__func__, cls_to_wrap.__name__, attr_name)
|
|
1111
|
+
setattr(cls_to_wrap, attr_name, staticmethod(wrapped))
|
|
1112
|
+
elif isinstance(attr_value, classmethod):
|
|
1113
|
+
wrapped = cls._create_conditional_method_wrapper(attr_value.__func__, cls_to_wrap.__name__, attr_name)
|
|
1114
|
+
setattr(cls_to_wrap, attr_name, classmethod(wrapped))
|
|
1115
|
+
elif callable(attr_value) and not isinstance(attr_value, type):
|
|
1116
|
+
# Regular instance methods
|
|
1117
|
+
if hasattr(attr_value, '__call__') and hasattr(attr_value, '__name__'):
|
|
1118
|
+
wrapped = cls._create_conditional_method_wrapper(attr_value, cls_to_wrap.__name__, attr_name)
|
|
1119
|
+
setattr(cls_to_wrap, attr_name, wrapped)
|
|
1120
|
+
|
|
1121
|
+
return cls_to_wrap
|
|
1122
|
+
|
|
1123
|
+
@classmethod
|
|
1124
|
+
def _log_exception_helper(cls, exception, context_info):
|
|
1125
|
+
"""
|
|
1126
|
+
DESCRIPTION:
|
|
1127
|
+
Helper function to log exceptions with consistent formatting.
|
|
1128
|
+
Skips TeradataMlException as it logs itself.
|
|
1129
|
+
|
|
1130
|
+
PARAMETERS:
|
|
1131
|
+
exception:
|
|
1132
|
+
Required Argument.
|
|
1133
|
+
Specifies the exception to log.
|
|
1134
|
+
Types: Exception
|
|
1135
|
+
|
|
1136
|
+
context_info:
|
|
1137
|
+
Required Argument.
|
|
1138
|
+
Specifies context information about where the exception occurred.
|
|
1139
|
+
Types: str
|
|
1140
|
+
|
|
1141
|
+
RETURNS:
|
|
1142
|
+
None
|
|
1143
|
+
|
|
1144
|
+
RAISES:
|
|
1145
|
+
None
|
|
1146
|
+
|
|
1147
|
+
EXAMPLES:
|
|
1148
|
+
>>> cls._log_exception_helper(e, "MyClass.__init__()")
|
|
1149
|
+
"""
|
|
1150
|
+
# Skip TeradataMlException as it logs itself
|
|
1151
|
+
if not exception.__class__.__name__ == 'TeradataMlException':
|
|
1152
|
+
try:
|
|
1153
|
+
# Log using teradataml logger
|
|
1154
|
+
logger = TeradataMlLogger.get_logger()
|
|
1155
|
+
# Check if logger has 'error' method for _NullLogger compatibility
|
|
1156
|
+
if hasattr(logger, 'error'):
|
|
1157
|
+
# Log exception with traceback
|
|
1158
|
+
error_msg = f"Exception in {context_info}: {type(exception).__name__}: {exception}"
|
|
1159
|
+
tb_lines = traceback.format_exc()
|
|
1160
|
+
logger.error(f"{error_msg}\nTraceback:\n{tb_lines}")
|
|
1161
|
+
except Exception:
|
|
1162
|
+
# If logging fails, continue
|
|
1163
|
+
pass
|
|
1164
|
+
|
|
1165
|
+
@classmethod
|
|
1166
|
+
def _create_conditional_method_wrapper(cls, method, class_name, method_name):
|
|
1167
|
+
"""
|
|
1168
|
+
DESCRIPTION:
|
|
1169
|
+
Build a wrapper for a class (instance / class / static) method that:
|
|
1170
|
+
* Always preserves original method signature (__name__, __doc__, etc.).
|
|
1171
|
+
* At call time checks the session flag (cls._prf_time_flag):
|
|
1172
|
+
- If PRF_TIME enabled: logs start/end (or failure) with elapsed wall time in seconds
|
|
1173
|
+
using logger.prf_time().
|
|
1174
|
+
- If PRF_TIME disabled: directly invokes the original method (single if branch cost).
|
|
1175
|
+
* On any exception (other than ones logging themselves) logs a formatted traceback via
|
|
1176
|
+
_log_exception_helper(), then re-raises to preserve original behavior.
|
|
1177
|
+
This keeps non‑PRF_TIME overhead to a single cheap conditional while still giving rich
|
|
1178
|
+
timing diagnostics when enabled.
|
|
1179
|
+
|
|
1180
|
+
PARAMETERS:
|
|
1181
|
+
method:
|
|
1182
|
+
Required Argument.
|
|
1183
|
+
Specifies the method to wrap.
|
|
1184
|
+
Types: Callable
|
|
1185
|
+
|
|
1186
|
+
class_name:
|
|
1187
|
+
Required Argument.
|
|
1188
|
+
Specifies the name of the class containing the method.
|
|
1189
|
+
Types: str
|
|
1190
|
+
|
|
1191
|
+
method_name:
|
|
1192
|
+
Required Argument.
|
|
1193
|
+
Specifies the name of the method to wrap.
|
|
1194
|
+
Types: str
|
|
1195
|
+
|
|
1196
|
+
RETURNS:
|
|
1197
|
+
Callable
|
|
1198
|
+
A conditional wrapper that switches between timing and direct execution.
|
|
1199
|
+
|
|
1200
|
+
RAISES:
|
|
1201
|
+
None
|
|
1202
|
+
|
|
1203
|
+
EXAMPLES:
|
|
1204
|
+
>>> wrapped = TeradataMlLogger._create_conditional_method_wrapper(method, "MyClass", "my_method")
|
|
1205
|
+
"""
|
|
1206
|
+
|
|
1207
|
+
# Use functools.wraps for standard attribute preservation
|
|
1208
|
+
@functools.wraps(method)
|
|
1209
|
+
def conditional_wrapper(*args, **kwargs):
|
|
1210
|
+
try:
|
|
1211
|
+
# Runtime check: if PRF_TIME flag enabled, add timing, else call method directly
|
|
1212
|
+
if cls._prf_time_flag:
|
|
1213
|
+
# Add timing for PRF_TIME level
|
|
1214
|
+
logger = TeradataMlLogger.get_logger()
|
|
1215
|
+
method_signature = f"{class_name}.{method_name}"
|
|
1216
|
+
|
|
1217
|
+
logger.prf_time(f"Started {method_signature}")
|
|
1218
|
+
start_time = time.perf_counter()
|
|
1219
|
+
|
|
1220
|
+
try:
|
|
1221
|
+
result = method(*args, **kwargs)
|
|
1222
|
+
elapsed = time.perf_counter() - start_time
|
|
1223
|
+
logger.prf_time(f"Completed {method_signature} in {elapsed:.5f} secs")
|
|
1224
|
+
return result
|
|
1225
|
+
except Exception as e:
|
|
1226
|
+
elapsed = time.perf_counter() - start_time
|
|
1227
|
+
logger.prf_time(f"Failed {method_signature} in {elapsed:.5f} secs")
|
|
1228
|
+
raise
|
|
1229
|
+
else:
|
|
1230
|
+
# Direct method call
|
|
1231
|
+
return method(*args, **kwargs)
|
|
1232
|
+
except Exception as e:
|
|
1233
|
+
# Automatic exception logging for all decorated methods
|
|
1234
|
+
cls._log_exception_helper(e, f"{class_name}.{method_name}()")
|
|
1235
|
+
# Re-raise the exception to maintain normal behavior so its visible to caller
|
|
1236
|
+
raise
|
|
1237
|
+
|
|
1238
|
+
return conditional_wrapper
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
# Global convenience function for backward compatibility
|
|
1242
|
+
def get_td_logger():
|
|
1243
|
+
"""
|
|
1244
|
+
DESCRIPTION:
|
|
1245
|
+
Get the teradataml session logger (convenience function).
|
|
1246
|
+
|
|
1247
|
+
PARAMETERS:
|
|
1248
|
+
None
|
|
1249
|
+
|
|
1250
|
+
RETURNS:
|
|
1251
|
+
_TeradataMlLogger or _NullLogger
|
|
1252
|
+
The TeradataML logger instance or null logger if NONE level.
|
|
1253
|
+
|
|
1254
|
+
RAISES:
|
|
1255
|
+
None
|
|
1256
|
+
|
|
1257
|
+
EXAMPLES:
|
|
1258
|
+
>>> logger = get_td_logger()
|
|
1259
|
+
>>> logger.info("Using convenience function")
|
|
1260
|
+
"""
|
|
1261
|
+
return TeradataMlLogger.get_logger()
|