teradataml 17.20.0.6__py3-none-any.whl → 20.0.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of teradataml might be problematic. Click here for more details.

Files changed (432) hide show
  1. teradataml/LICENSE-3RD-PARTY.pdf +0 -0
  2. teradataml/LICENSE.pdf +0 -0
  3. teradataml/README.md +238 -1
  4. teradataml/__init__.py +13 -3
  5. teradataml/_version.py +1 -1
  6. teradataml/analytics/Transformations.py +4 -4
  7. teradataml/analytics/__init__.py +0 -2
  8. teradataml/analytics/analytic_function_executor.py +3 -0
  9. teradataml/analytics/json_parser/utils.py +13 -12
  10. teradataml/analytics/sqle/DecisionTreePredict.py +15 -30
  11. teradataml/analytics/sqle/NaiveBayesPredict.py +11 -20
  12. teradataml/analytics/sqle/__init__.py +0 -13
  13. teradataml/analytics/utils.py +1 -0
  14. teradataml/analytics/valib.py +3 -0
  15. teradataml/automl/__init__.py +1628 -0
  16. teradataml/automl/custom_json_utils.py +1270 -0
  17. teradataml/automl/data_preparation.py +993 -0
  18. teradataml/automl/data_transformation.py +727 -0
  19. teradataml/automl/feature_engineering.py +1648 -0
  20. teradataml/automl/feature_exploration.py +547 -0
  21. teradataml/automl/model_evaluation.py +163 -0
  22. teradataml/automl/model_training.py +887 -0
  23. teradataml/catalog/__init__.py +0 -2
  24. teradataml/catalog/byom.py +49 -6
  25. teradataml/catalog/function_argument_mapper.py +0 -2
  26. teradataml/catalog/model_cataloging_utils.py +2 -1021
  27. teradataml/common/aed_utils.py +6 -2
  28. teradataml/common/constants.py +50 -58
  29. teradataml/common/deprecations.py +160 -0
  30. teradataml/common/garbagecollector.py +61 -104
  31. teradataml/common/messagecodes.py +27 -36
  32. teradataml/common/messages.py +11 -15
  33. teradataml/common/utils.py +205 -287
  34. teradataml/common/wrapper_utils.py +1 -110
  35. teradataml/context/context.py +150 -78
  36. teradataml/data/bank_churn.csv +10001 -0
  37. teradataml/data/bmi.csv +501 -0
  38. teradataml/data/docs/sqle/docs_17_10/BincodeFit.py +3 -3
  39. teradataml/data/docs/sqle/docs_17_10/BincodeTransform.py +6 -5
  40. teradataml/data/docs/sqle/docs_17_10/Fit.py +1 -1
  41. teradataml/data/docs/sqle/docs_17_10/OneHotEncodingTransform.py +1 -1
  42. teradataml/data/docs/sqle/docs_17_10/OutlierFilterTransform.py +1 -1
  43. teradataml/data/docs/sqle/docs_17_10/PolynomialFeaturesTransform.py +2 -2
  44. teradataml/data/docs/sqle/docs_17_10/RowNormalizeTransform.py +2 -1
  45. teradataml/data/docs/sqle/docs_17_10/ScaleTransform.py +1 -0
  46. teradataml/data/docs/sqle/docs_17_10/SimpleImputeTransform.py +1 -1
  47. teradataml/data/docs/sqle/docs_17_10/Transform.py +2 -1
  48. teradataml/data/docs/sqle/docs_17_20/BincodeFit.py +3 -3
  49. teradataml/data/docs/sqle/docs_17_20/BincodeTransform.py +6 -5
  50. teradataml/data/docs/sqle/docs_17_20/Fit.py +1 -1
  51. teradataml/data/docs/sqle/docs_17_20/GLM.py +1 -1
  52. teradataml/data/docs/sqle/docs_17_20/GLMPredictPerSegment.py +9 -10
  53. teradataml/data/docs/sqle/docs_17_20/KMeansPredict.py +3 -2
  54. teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierPredict.py +16 -15
  55. teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierTrainer.py +2 -2
  56. teradataml/data/docs/sqle/docs_17_20/NonLinearCombineFit.py +2 -2
  57. teradataml/data/docs/sqle/docs_17_20/NonLinearCombineTransform.py +8 -8
  58. teradataml/data/docs/sqle/docs_17_20/OneClassSVMPredict.py +21 -20
  59. teradataml/data/docs/sqle/docs_17_20/OneHotEncodingTransform.py +1 -1
  60. teradataml/data/docs/sqle/docs_17_20/OutlierFilterTransform.py +8 -3
  61. teradataml/data/docs/sqle/docs_17_20/PolynomialFeaturesTransform.py +6 -5
  62. teradataml/data/docs/sqle/docs_17_20/RandomProjectionTransform.py +6 -6
  63. teradataml/data/docs/sqle/docs_17_20/RowNormalizeTransform.py +2 -1
  64. teradataml/data/docs/sqle/docs_17_20/SVM.py +1 -1
  65. teradataml/data/docs/sqle/docs_17_20/SVMPredict.py +16 -16
  66. teradataml/data/docs/sqle/docs_17_20/ScaleTransform.py +1 -0
  67. teradataml/data/docs/sqle/docs_17_20/SimpleImputeTransform.py +3 -2
  68. teradataml/data/docs/sqle/docs_17_20/TDDecisionForestPredict.py +4 -4
  69. teradataml/data/docs/sqle/docs_17_20/TDGLMPredict.py +19 -19
  70. teradataml/data/docs/sqle/docs_17_20/TargetEncodingTransform.py +5 -4
  71. teradataml/data/docs/sqle/docs_17_20/Transform.py +2 -2
  72. teradataml/data/docs/sqle/docs_17_20/XGBoostPredict.py +9 -9
  73. teradataml/data/fish.csv +160 -0
  74. teradataml/data/glass_types.csv +215 -0
  75. teradataml/data/insurance.csv +1 -1
  76. teradataml/data/iris_data.csv +151 -0
  77. teradataml/data/jsons/sqle/17.10/TD_FunctionTransform.json +1 -0
  78. teradataml/data/jsons/sqle/17.10/TD_OneHotEncodingTransform.json +1 -0
  79. teradataml/data/jsons/sqle/17.10/TD_OutlierFilterTransform.json +1 -0
  80. teradataml/data/jsons/sqle/17.10/TD_PolynomialFeaturesTransform.json +1 -0
  81. teradataml/data/jsons/sqle/17.10/TD_RowNormalizeTransform.json +1 -0
  82. teradataml/data/jsons/sqle/17.10/TD_ScaleTransform.json +1 -0
  83. teradataml/data/jsons/sqle/17.10/TD_SimpleImputeTransform.json +1 -0
  84. teradataml/data/load_example_data.py +3 -0
  85. teradataml/data/multi_model_classification.csv +401 -0
  86. teradataml/data/multi_model_regression.csv +401 -0
  87. teradataml/data/openml_example.json +63 -0
  88. teradataml/data/scripts/deploy_script.py +65 -0
  89. teradataml/data/scripts/mapper.R +20 -0
  90. teradataml/data/scripts/sklearn/__init__.py +0 -0
  91. teradataml/data/scripts/sklearn/sklearn_fit.py +175 -0
  92. teradataml/data/scripts/sklearn/sklearn_fit_predict.py +135 -0
  93. teradataml/data/scripts/sklearn/sklearn_function.template +113 -0
  94. teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +158 -0
  95. teradataml/data/scripts/sklearn/sklearn_neighbors.py +152 -0
  96. teradataml/data/scripts/sklearn/sklearn_score.py +128 -0
  97. teradataml/data/scripts/sklearn/sklearn_transform.py +179 -0
  98. teradataml/data/templates/open_source_ml.json +9 -0
  99. teradataml/data/teradataml_example.json +73 -1
  100. teradataml/data/test_classification.csv +101 -0
  101. teradataml/data/test_prediction.csv +101 -0
  102. teradataml/data/test_regression.csv +101 -0
  103. teradataml/data/train_multiclass.csv +101 -0
  104. teradataml/data/train_regression.csv +101 -0
  105. teradataml/data/train_regression_multiple_labels.csv +101 -0
  106. teradataml/data/wine_data.csv +1600 -0
  107. teradataml/dataframe/copy_to.py +79 -13
  108. teradataml/dataframe/data_transfer.py +8 -0
  109. teradataml/dataframe/dataframe.py +910 -311
  110. teradataml/dataframe/dataframe_utils.py +102 -5
  111. teradataml/dataframe/fastload.py +11 -3
  112. teradataml/dataframe/setop.py +15 -2
  113. teradataml/dataframe/sql.py +3735 -77
  114. teradataml/dataframe/sql_function_parameters.py +56 -5
  115. teradataml/dataframe/vantage_function_types.py +45 -1
  116. teradataml/dataframe/window.py +30 -29
  117. teradataml/dbutils/dbutils.py +18 -1
  118. teradataml/geospatial/geodataframe.py +18 -7
  119. teradataml/geospatial/geodataframecolumn.py +5 -0
  120. teradataml/hyperparameter_tuner/optimizer.py +910 -120
  121. teradataml/hyperparameter_tuner/utils.py +131 -37
  122. teradataml/lib/aed_0_1.dll +0 -0
  123. teradataml/lib/libaed_0_1.dylib +0 -0
  124. teradataml/lib/libaed_0_1.so +0 -0
  125. teradataml/libaed_0_1.dylib +0 -0
  126. teradataml/libaed_0_1.so +0 -0
  127. teradataml/opensource/__init__.py +1 -0
  128. teradataml/opensource/sklearn/__init__.py +1 -0
  129. teradataml/opensource/sklearn/_class.py +255 -0
  130. teradataml/opensource/sklearn/_sklearn_wrapper.py +1668 -0
  131. teradataml/opensource/sklearn/_wrapper_utils.py +268 -0
  132. teradataml/opensource/sklearn/constants.py +54 -0
  133. teradataml/options/__init__.py +3 -6
  134. teradataml/options/configure.py +21 -20
  135. teradataml/scriptmgmt/UserEnv.py +61 -5
  136. teradataml/scriptmgmt/lls_utils.py +135 -53
  137. teradataml/table_operators/Apply.py +38 -6
  138. teradataml/table_operators/Script.py +45 -308
  139. teradataml/table_operators/TableOperator.py +182 -591
  140. teradataml/table_operators/__init__.py +0 -1
  141. teradataml/table_operators/table_operator_util.py +32 -40
  142. teradataml/utils/validators.py +127 -3
  143. {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/METADATA +243 -3
  144. {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/RECORD +147 -391
  145. teradataml/analytics/mle/AdaBoost.py +0 -651
  146. teradataml/analytics/mle/AdaBoostPredict.py +0 -564
  147. teradataml/analytics/mle/Antiselect.py +0 -342
  148. teradataml/analytics/mle/Arima.py +0 -641
  149. teradataml/analytics/mle/ArimaPredict.py +0 -477
  150. teradataml/analytics/mle/Attribution.py +0 -1070
  151. teradataml/analytics/mle/Betweenness.py +0 -658
  152. teradataml/analytics/mle/Burst.py +0 -711
  153. teradataml/analytics/mle/CCM.py +0 -600
  154. teradataml/analytics/mle/CCMPrepare.py +0 -324
  155. teradataml/analytics/mle/CFilter.py +0 -460
  156. teradataml/analytics/mle/ChangePointDetection.py +0 -572
  157. teradataml/analytics/mle/ChangePointDetectionRT.py +0 -477
  158. teradataml/analytics/mle/Closeness.py +0 -737
  159. teradataml/analytics/mle/ConfusionMatrix.py +0 -420
  160. teradataml/analytics/mle/Correlation.py +0 -477
  161. teradataml/analytics/mle/Correlation2.py +0 -573
  162. teradataml/analytics/mle/CoxHazardRatio.py +0 -679
  163. teradataml/analytics/mle/CoxPH.py +0 -556
  164. teradataml/analytics/mle/CoxSurvival.py +0 -478
  165. teradataml/analytics/mle/CumulativeMovAvg.py +0 -363
  166. teradataml/analytics/mle/DTW.py +0 -623
  167. teradataml/analytics/mle/DWT.py +0 -564
  168. teradataml/analytics/mle/DWT2D.py +0 -599
  169. teradataml/analytics/mle/DecisionForest.py +0 -716
  170. teradataml/analytics/mle/DecisionForestEvaluator.py +0 -363
  171. teradataml/analytics/mle/DecisionForestPredict.py +0 -561
  172. teradataml/analytics/mle/DecisionTree.py +0 -830
  173. teradataml/analytics/mle/DecisionTreePredict.py +0 -528
  174. teradataml/analytics/mle/ExponentialMovAvg.py +0 -418
  175. teradataml/analytics/mle/FMeasure.py +0 -402
  176. teradataml/analytics/mle/FPGrowth.py +0 -734
  177. teradataml/analytics/mle/FrequentPaths.py +0 -695
  178. teradataml/analytics/mle/GLM.py +0 -558
  179. teradataml/analytics/mle/GLML1L2.py +0 -547
  180. teradataml/analytics/mle/GLML1L2Predict.py +0 -519
  181. teradataml/analytics/mle/GLMPredict.py +0 -529
  182. teradataml/analytics/mle/HMMDecoder.py +0 -945
  183. teradataml/analytics/mle/HMMEvaluator.py +0 -901
  184. teradataml/analytics/mle/HMMSupervised.py +0 -521
  185. teradataml/analytics/mle/HMMUnsupervised.py +0 -572
  186. teradataml/analytics/mle/Histogram.py +0 -561
  187. teradataml/analytics/mle/IDWT.py +0 -476
  188. teradataml/analytics/mle/IDWT2D.py +0 -493
  189. teradataml/analytics/mle/IdentityMatch.py +0 -763
  190. teradataml/analytics/mle/Interpolator.py +0 -918
  191. teradataml/analytics/mle/KMeans.py +0 -485
  192. teradataml/analytics/mle/KNN.py +0 -627
  193. teradataml/analytics/mle/KNNRecommender.py +0 -488
  194. teradataml/analytics/mle/KNNRecommenderPredict.py +0 -581
  195. teradataml/analytics/mle/LAR.py +0 -439
  196. teradataml/analytics/mle/LARPredict.py +0 -478
  197. teradataml/analytics/mle/LDA.py +0 -548
  198. teradataml/analytics/mle/LDAInference.py +0 -492
  199. teradataml/analytics/mle/LDATopicSummary.py +0 -464
  200. teradataml/analytics/mle/LevenshteinDistance.py +0 -450
  201. teradataml/analytics/mle/LinReg.py +0 -433
  202. teradataml/analytics/mle/LinRegPredict.py +0 -438
  203. teradataml/analytics/mle/MinHash.py +0 -544
  204. teradataml/analytics/mle/Modularity.py +0 -587
  205. teradataml/analytics/mle/NEREvaluator.py +0 -410
  206. teradataml/analytics/mle/NERExtractor.py +0 -595
  207. teradataml/analytics/mle/NERTrainer.py +0 -458
  208. teradataml/analytics/mle/NGrams.py +0 -570
  209. teradataml/analytics/mle/NPath.py +0 -634
  210. teradataml/analytics/mle/NTree.py +0 -549
  211. teradataml/analytics/mle/NaiveBayes.py +0 -462
  212. teradataml/analytics/mle/NaiveBayesPredict.py +0 -513
  213. teradataml/analytics/mle/NaiveBayesTextClassifier.py +0 -607
  214. teradataml/analytics/mle/NaiveBayesTextClassifier2.py +0 -531
  215. teradataml/analytics/mle/NaiveBayesTextClassifierPredict.py +0 -799
  216. teradataml/analytics/mle/NamedEntityFinder.py +0 -529
  217. teradataml/analytics/mle/NamedEntityFinderEvaluator.py +0 -414
  218. teradataml/analytics/mle/NamedEntityFinderTrainer.py +0 -396
  219. teradataml/analytics/mle/POSTagger.py +0 -417
  220. teradataml/analytics/mle/Pack.py +0 -411
  221. teradataml/analytics/mle/PageRank.py +0 -535
  222. teradataml/analytics/mle/PathAnalyzer.py +0 -426
  223. teradataml/analytics/mle/PathGenerator.py +0 -367
  224. teradataml/analytics/mle/PathStart.py +0 -464
  225. teradataml/analytics/mle/PathSummarizer.py +0 -470
  226. teradataml/analytics/mle/Pivot.py +0 -471
  227. teradataml/analytics/mle/ROC.py +0 -425
  228. teradataml/analytics/mle/RandomSample.py +0 -637
  229. teradataml/analytics/mle/RandomWalkSample.py +0 -490
  230. teradataml/analytics/mle/SAX.py +0 -779
  231. teradataml/analytics/mle/SVMDense.py +0 -677
  232. teradataml/analytics/mle/SVMDensePredict.py +0 -536
  233. teradataml/analytics/mle/SVMDenseSummary.py +0 -437
  234. teradataml/analytics/mle/SVMSparse.py +0 -557
  235. teradataml/analytics/mle/SVMSparsePredict.py +0 -553
  236. teradataml/analytics/mle/SVMSparseSummary.py +0 -435
  237. teradataml/analytics/mle/Sampling.py +0 -549
  238. teradataml/analytics/mle/Scale.py +0 -565
  239. teradataml/analytics/mle/ScaleByPartition.py +0 -496
  240. teradataml/analytics/mle/ScaleMap.py +0 -378
  241. teradataml/analytics/mle/ScaleSummary.py +0 -320
  242. teradataml/analytics/mle/SentenceExtractor.py +0 -363
  243. teradataml/analytics/mle/SentimentEvaluator.py +0 -432
  244. teradataml/analytics/mle/SentimentExtractor.py +0 -578
  245. teradataml/analytics/mle/SentimentTrainer.py +0 -405
  246. teradataml/analytics/mle/SeriesSplitter.py +0 -641
  247. teradataml/analytics/mle/Sessionize.py +0 -475
  248. teradataml/analytics/mle/SimpleMovAvg.py +0 -397
  249. teradataml/analytics/mle/StringSimilarity.py +0 -425
  250. teradataml/analytics/mle/TF.py +0 -389
  251. teradataml/analytics/mle/TFIDF.py +0 -504
  252. teradataml/analytics/mle/TextChunker.py +0 -414
  253. teradataml/analytics/mle/TextClassifier.py +0 -399
  254. teradataml/analytics/mle/TextClassifierEvaluator.py +0 -413
  255. teradataml/analytics/mle/TextClassifierTrainer.py +0 -565
  256. teradataml/analytics/mle/TextMorph.py +0 -494
  257. teradataml/analytics/mle/TextParser.py +0 -623
  258. teradataml/analytics/mle/TextTagger.py +0 -530
  259. teradataml/analytics/mle/TextTokenizer.py +0 -502
  260. teradataml/analytics/mle/UnivariateStatistics.py +0 -488
  261. teradataml/analytics/mle/Unpack.py +0 -526
  262. teradataml/analytics/mle/Unpivot.py +0 -438
  263. teradataml/analytics/mle/VarMax.py +0 -776
  264. teradataml/analytics/mle/VectorDistance.py +0 -762
  265. teradataml/analytics/mle/WeightedMovAvg.py +0 -400
  266. teradataml/analytics/mle/XGBoost.py +0 -842
  267. teradataml/analytics/mle/XGBoostPredict.py +0 -627
  268. teradataml/analytics/mle/__init__.py +0 -123
  269. teradataml/analytics/mle/json/adaboost_mle.json +0 -135
  270. teradataml/analytics/mle/json/adaboostpredict_mle.json +0 -85
  271. teradataml/analytics/mle/json/antiselect_mle.json +0 -34
  272. teradataml/analytics/mle/json/antiselect_mle_mle.json +0 -34
  273. teradataml/analytics/mle/json/arima_mle.json +0 -172
  274. teradataml/analytics/mle/json/arimapredict_mle.json +0 -52
  275. teradataml/analytics/mle/json/attribution_mle_mle.json +0 -143
  276. teradataml/analytics/mle/json/betweenness_mle.json +0 -97
  277. teradataml/analytics/mle/json/burst_mle.json +0 -140
  278. teradataml/analytics/mle/json/ccm_mle.json +0 -124
  279. teradataml/analytics/mle/json/ccmprepare_mle.json +0 -14
  280. teradataml/analytics/mle/json/cfilter_mle.json +0 -93
  281. teradataml/analytics/mle/json/changepointdetection_mle.json +0 -92
  282. teradataml/analytics/mle/json/changepointdetectionrt_mle.json +0 -78
  283. teradataml/analytics/mle/json/closeness_mle.json +0 -104
  284. teradataml/analytics/mle/json/confusionmatrix_mle.json +0 -79
  285. teradataml/analytics/mle/json/correlation_mle.json +0 -86
  286. teradataml/analytics/mle/json/correlationreduce_mle.json +0 -49
  287. teradataml/analytics/mle/json/coxhazardratio_mle.json +0 -89
  288. teradataml/analytics/mle/json/coxph_mle.json +0 -98
  289. teradataml/analytics/mle/json/coxsurvival_mle.json +0 -79
  290. teradataml/analytics/mle/json/cumulativemovavg_mle.json +0 -34
  291. teradataml/analytics/mle/json/decisionforest_mle.json +0 -167
  292. teradataml/analytics/mle/json/decisionforestevaluator_mle.json +0 -33
  293. teradataml/analytics/mle/json/decisionforestpredict_mle_mle.json +0 -74
  294. teradataml/analytics/mle/json/decisiontree_mle.json +0 -194
  295. teradataml/analytics/mle/json/decisiontreepredict_mle_mle.json +0 -86
  296. teradataml/analytics/mle/json/dtw_mle.json +0 -97
  297. teradataml/analytics/mle/json/dwt2d_mle.json +0 -116
  298. teradataml/analytics/mle/json/dwt_mle.json +0 -101
  299. teradataml/analytics/mle/json/exponentialmovavg_mle.json +0 -55
  300. teradataml/analytics/mle/json/fmeasure_mle.json +0 -58
  301. teradataml/analytics/mle/json/fpgrowth_mle.json +0 -159
  302. teradataml/analytics/mle/json/frequentpaths_mle.json +0 -129
  303. teradataml/analytics/mle/json/glm_mle.json +0 -111
  304. teradataml/analytics/mle/json/glml1l2_mle.json +0 -106
  305. teradataml/analytics/mle/json/glml1l2predict_mle.json +0 -57
  306. teradataml/analytics/mle/json/glmpredict_mle_mle.json +0 -74
  307. teradataml/analytics/mle/json/histogram_mle.json +0 -100
  308. teradataml/analytics/mle/json/hmmdecoder_mle.json +0 -192
  309. teradataml/analytics/mle/json/hmmevaluator_mle.json +0 -206
  310. teradataml/analytics/mle/json/hmmsupervised_mle.json +0 -91
  311. teradataml/analytics/mle/json/hmmunsupervised_mle.json +0 -114
  312. teradataml/analytics/mle/json/identitymatch_mle.json +0 -88
  313. teradataml/analytics/mle/json/idwt2d_mle.json +0 -73
  314. teradataml/analytics/mle/json/idwt_mle.json +0 -66
  315. teradataml/analytics/mle/json/interpolator_mle.json +0 -151
  316. teradataml/analytics/mle/json/kmeans_mle.json +0 -97
  317. teradataml/analytics/mle/json/knn_mle.json +0 -141
  318. teradataml/analytics/mle/json/knnrecommender_mle.json +0 -111
  319. teradataml/analytics/mle/json/knnrecommenderpredict_mle.json +0 -75
  320. teradataml/analytics/mle/json/lar_mle.json +0 -78
  321. teradataml/analytics/mle/json/larpredict_mle.json +0 -69
  322. teradataml/analytics/mle/json/lda_mle.json +0 -130
  323. teradataml/analytics/mle/json/ldainference_mle.json +0 -78
  324. teradataml/analytics/mle/json/ldatopicsummary_mle.json +0 -64
  325. teradataml/analytics/mle/json/levenshteindistance_mle.json +0 -92
  326. teradataml/analytics/mle/json/linreg_mle.json +0 -42
  327. teradataml/analytics/mle/json/linregpredict_mle.json +0 -56
  328. teradataml/analytics/mle/json/minhash_mle.json +0 -113
  329. teradataml/analytics/mle/json/modularity_mle.json +0 -91
  330. teradataml/analytics/mle/json/naivebayespredict_mle_mle.json +0 -85
  331. teradataml/analytics/mle/json/naivebayesreduce_mle.json +0 -52
  332. teradataml/analytics/mle/json/naivebayestextclassifierpredict_mle_mle.json +0 -147
  333. teradataml/analytics/mle/json/naivebayestextclassifiertrainer2_mle.json +0 -108
  334. teradataml/analytics/mle/json/naivebayestextclassifiertrainer_mle.json +0 -102
  335. teradataml/analytics/mle/json/namedentityfinder_mle.json +0 -84
  336. teradataml/analytics/mle/json/namedentityfinderevaluatorreduce_mle.json +0 -43
  337. teradataml/analytics/mle/json/namedentityfindertrainer_mle.json +0 -64
  338. teradataml/analytics/mle/json/nerevaluator_mle.json +0 -54
  339. teradataml/analytics/mle/json/nerextractor_mle.json +0 -87
  340. teradataml/analytics/mle/json/nertrainer_mle.json +0 -89
  341. teradataml/analytics/mle/json/ngrams_mle.json +0 -137
  342. teradataml/analytics/mle/json/ngramsplitter_mle_mle.json +0 -137
  343. teradataml/analytics/mle/json/npath@coprocessor_mle.json +0 -73
  344. teradataml/analytics/mle/json/ntree@coprocessor_mle.json +0 -123
  345. teradataml/analytics/mle/json/pack_mle.json +0 -58
  346. teradataml/analytics/mle/json/pack_mle_mle.json +0 -58
  347. teradataml/analytics/mle/json/pagerank_mle.json +0 -81
  348. teradataml/analytics/mle/json/pathanalyzer_mle.json +0 -63
  349. teradataml/analytics/mle/json/pathgenerator_mle.json +0 -40
  350. teradataml/analytics/mle/json/pathstart_mle.json +0 -62
  351. teradataml/analytics/mle/json/pathsummarizer_mle.json +0 -72
  352. teradataml/analytics/mle/json/pivoting_mle.json +0 -71
  353. teradataml/analytics/mle/json/postagger_mle.json +0 -51
  354. teradataml/analytics/mle/json/randomsample_mle.json +0 -131
  355. teradataml/analytics/mle/json/randomwalksample_mle.json +0 -85
  356. teradataml/analytics/mle/json/roc_mle.json +0 -73
  357. teradataml/analytics/mle/json/sampling_mle.json +0 -75
  358. teradataml/analytics/mle/json/sax_mle.json +0 -154
  359. teradataml/analytics/mle/json/scale_mle.json +0 -93
  360. teradataml/analytics/mle/json/scalebypartition_mle.json +0 -89
  361. teradataml/analytics/mle/json/scalemap_mle.json +0 -44
  362. teradataml/analytics/mle/json/scalesummary_mle.json +0 -14
  363. teradataml/analytics/mle/json/sentenceextractor_mle.json +0 -41
  364. teradataml/analytics/mle/json/sentimentevaluator_mle.json +0 -43
  365. teradataml/analytics/mle/json/sentimentextractor_mle.json +0 -100
  366. teradataml/analytics/mle/json/sentimenttrainer_mle.json +0 -68
  367. teradataml/analytics/mle/json/seriessplitter_mle.json +0 -133
  368. teradataml/analytics/mle/json/sessionize_mle_mle.json +0 -62
  369. teradataml/analytics/mle/json/simplemovavg_mle.json +0 -48
  370. teradataml/analytics/mle/json/stringsimilarity_mle.json +0 -50
  371. teradataml/analytics/mle/json/stringsimilarity_mle_mle.json +0 -50
  372. teradataml/analytics/mle/json/svmdense_mle.json +0 -165
  373. teradataml/analytics/mle/json/svmdensepredict_mle.json +0 -95
  374. teradataml/analytics/mle/json/svmdensesummary_mle.json +0 -58
  375. teradataml/analytics/mle/json/svmsparse_mle.json +0 -148
  376. teradataml/analytics/mle/json/svmsparsepredict_mle_mle.json +0 -103
  377. teradataml/analytics/mle/json/svmsparsesummary_mle.json +0 -57
  378. teradataml/analytics/mle/json/textchunker_mle.json +0 -40
  379. teradataml/analytics/mle/json/textclassifier_mle.json +0 -51
  380. teradataml/analytics/mle/json/textclassifierevaluator_mle.json +0 -43
  381. teradataml/analytics/mle/json/textclassifiertrainer_mle.json +0 -103
  382. teradataml/analytics/mle/json/textmorph_mle.json +0 -63
  383. teradataml/analytics/mle/json/textparser_mle.json +0 -166
  384. teradataml/analytics/mle/json/texttagger_mle.json +0 -81
  385. teradataml/analytics/mle/json/texttokenizer_mle.json +0 -91
  386. teradataml/analytics/mle/json/tf_mle.json +0 -33
  387. teradataml/analytics/mle/json/tfidf_mle.json +0 -34
  388. teradataml/analytics/mle/json/univariatestatistics_mle.json +0 -81
  389. teradataml/analytics/mle/json/unpack_mle.json +0 -91
  390. teradataml/analytics/mle/json/unpack_mle_mle.json +0 -91
  391. teradataml/analytics/mle/json/unpivoting_mle.json +0 -63
  392. teradataml/analytics/mle/json/varmax_mle.json +0 -176
  393. teradataml/analytics/mle/json/vectordistance_mle.json +0 -179
  394. teradataml/analytics/mle/json/weightedmovavg_mle.json +0 -48
  395. teradataml/analytics/mle/json/xgboost_mle.json +0 -178
  396. teradataml/analytics/mle/json/xgboostpredict_mle.json +0 -104
  397. teradataml/analytics/sqle/Antiselect.py +0 -321
  398. teradataml/analytics/sqle/Attribution.py +0 -603
  399. teradataml/analytics/sqle/DecisionForestPredict.py +0 -408
  400. teradataml/analytics/sqle/GLMPredict.py +0 -430
  401. teradataml/analytics/sqle/MovingAverage.py +0 -543
  402. teradataml/analytics/sqle/NGramSplitter.py +0 -548
  403. teradataml/analytics/sqle/NPath.py +0 -632
  404. teradataml/analytics/sqle/NaiveBayesTextClassifierPredict.py +0 -515
  405. teradataml/analytics/sqle/Pack.py +0 -388
  406. teradataml/analytics/sqle/SVMSparsePredict.py +0 -464
  407. teradataml/analytics/sqle/Sessionize.py +0 -390
  408. teradataml/analytics/sqle/StringSimilarity.py +0 -400
  409. teradataml/analytics/sqle/Unpack.py +0 -503
  410. teradataml/analytics/sqle/json/antiselect_sqle.json +0 -21
  411. teradataml/analytics/sqle/json/attribution_sqle.json +0 -92
  412. teradataml/analytics/sqle/json/decisionforestpredict_sqle.json +0 -48
  413. teradataml/analytics/sqle/json/glmpredict_sqle.json +0 -48
  414. teradataml/analytics/sqle/json/h2opredict_sqle.json +0 -63
  415. teradataml/analytics/sqle/json/movingaverage_sqle.json +0 -58
  416. teradataml/analytics/sqle/json/naivebayestextclassifierpredict_sqle.json +0 -76
  417. teradataml/analytics/sqle/json/ngramsplitter_sqle.json +0 -126
  418. teradataml/analytics/sqle/json/npath_sqle.json +0 -67
  419. teradataml/analytics/sqle/json/pack_sqle.json +0 -47
  420. teradataml/analytics/sqle/json/pmmlpredict_sqle.json +0 -55
  421. teradataml/analytics/sqle/json/sessionize_sqle.json +0 -43
  422. teradataml/analytics/sqle/json/stringsimilarity_sqle.json +0 -39
  423. teradataml/analytics/sqle/json/svmsparsepredict_sqle.json +0 -74
  424. teradataml/analytics/sqle/json/unpack_sqle.json +0 -80
  425. teradataml/catalog/model_cataloging.py +0 -980
  426. teradataml/config/mlengine_alias_definitions_v1.0 +0 -118
  427. teradataml/config/mlengine_alias_definitions_v1.1 +0 -127
  428. teradataml/config/mlengine_alias_definitions_v1.3 +0 -129
  429. teradataml/table_operators/sandbox_container_util.py +0 -643
  430. {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/WHEEL +0 -0
  431. {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/top_level.txt +0 -0
  432. {teradataml-17.20.0.6.dist-info → teradataml-20.0.0.0.dist-info}/zip-safe +0 -0
@@ -1249,7 +1249,7 @@ class AedUtils:
1249
1249
 
1250
1250
  return self.aed_context._validate_aed_return_code(ret_code[0], node_type)
1251
1251
 
1252
- def _aed_groupby(self, nodeid, groupby_expr):
1252
+ def _aed_groupby(self, nodeid, groupby_expr, option=None):
1253
1253
  """
1254
1254
  This wrapper function facilitates a integration with 'aed_groupby',
1255
1255
  a C++ function, in AED library, with Python tdml library.
@@ -1260,6 +1260,7 @@ class AedUtils:
1260
1260
  PARAMETERS:
1261
1261
  nodeid - A DAG node, a input to the select API.
1262
1262
  groupby_expr - Columns, to be given from the data frame.
1263
+ option - Option, to be given from the GROUP BY Clause.
1263
1264
 
1264
1265
  EXAMPLES:
1265
1266
  aed_table_nodeid = AedObj._aed_table("dbname.tablename")
@@ -1284,7 +1285,10 @@ class AedUtils:
1284
1285
  ]
1285
1286
 
1286
1287
  arg_name = ["group by"]
1287
- arg_value = [groupby_expr]
1288
+ # If option is passed, add prefix of the option to the groupby_expr,
1289
+ # else, add prefix as empty string.
1290
+ arg_value = ["{} | {}".format(option, groupby_expr)] if option\
1291
+ else ["{}| {}".format("", groupby_expr)]
1288
1292
  temp_table_name = UtilFuncs._generate_temp_table_name(prefix="groupby_", use_default_database=True, quote=False)
1289
1293
  output_table = [UtilFuncs._extract_table_name(temp_table_name)]
1290
1294
  output_schema = [UtilFuncs._extract_db_name(temp_table_name)]
@@ -64,14 +64,14 @@ class TeradataConstants(Enum):
64
64
  TERADATA_LOCAL_SCRIPT = 4
65
65
  CONTAINER = 5
66
66
  TERADATA_TEXT_FILE = 6
67
+ TERADATA_APPLY = 7
67
68
  TABLE_COLUMN_LIMIT = 2048
68
69
  TERADATA_JOINS = ["inner", "left", "right", "full", "cross"]
69
70
  TERADATA_JOIN_OPERATORS = ['>=', '<=', '<>', '!=', '>', '<', '=']
70
71
  # Order of operators
71
72
  # shouldn't be changed. This is the order in which join condition is tested - first, operators
72
73
  # with two characters and then the operators with single character.
73
- SUPPORTED_ENGINES = {"ENGINE_ML" : {"name" : "mle", "file" : "mlengine_alias_definitions"},
74
- "ENGINE_SQL" : {"name" : "sqle", "file" : "sqlengine_alias_definitions"}}
74
+ SUPPORTED_ENGINES = {"ENGINE_SQL" : {"name" : "sqle", "file" : "sqlengine_alias_definitions"}}
75
75
  SUPPORTED_VANTAGE_VERSIONS = {"vantage1.0": "v1.0", "vantage1.1": "v1.1",
76
76
  "vantage1.3": "v1.3", "vantage2.0": "v1.1"}
77
77
  RANGE_SEPARATORS = [":"]
@@ -179,65 +179,16 @@ class FunctionArgumentMapperConstants(Enum):
179
179
 
180
180
  class ModelCatalogingConstants(Enum):
181
181
  MODEL_CATALOG_DB = "TD_ModelCataloging"
182
- MODEL_ENGINE_ML = "ML Engine"
183
182
  MODEL_ENGINE_ADVSQL = "Advanced SQL Engine"
184
183
 
185
- MODEL_TDML = "teradataml"
186
-
187
- # Stored Procedure Names
188
- SAVE_MODEL = "SYSLIB.SaveModel"
189
- DELETE_MODEL = "SYSLIB.DeleteModel"
190
- PUBLISH_MODEL = "SYSLIB.PublishModel"
191
-
192
184
  # ModelCataloging Direct Views
193
185
  MODELS = "ModelsV"
194
- MODELS_DETAILS = "ModelDetailsV"
195
- MODELS_OBJECTS = "ModelObjectsV"
196
- MODELS_ATTRS = "ModelAttributesV"
197
- MODELS_PERF = "ModelPerformanceV"
198
- MODELS_LOC = "ModelLocationV"
199
186
 
200
187
  # ModelCataloging Derived Views
201
188
  MODELSX = "ModelsVX"
202
- MODELS_DETAILSX = "ModelDetailsVX"
203
- MODELS_INPUTSX = "ModelTrainingDataVX"
204
189
 
205
190
  # Columns names used for Filter
206
- MODEL_NAME = "Name"
207
- MODEL_ID = "ModelId"
208
191
  CREATED_BY = "CreatedBy"
209
- MODEL_ACCESS = "ModelAccess"
210
- MODEL_DERIVED_NAME = "ModelName"
211
- MODEL_DERIVED_ALGORITHM = "ModelAlgorithm"
212
- MODEL_DERIVED_PREDICTION_TYPE = "ModelPredictionType"
213
- MODEL_DERIVED_BUILD_TIME = "ModelBuildTime"
214
- MODEL_DERIVED_TARGET_COLUMN = "ModelTargetColumn"
215
- MODEL_DERIVED_GENENG = "ModelGeneratingEngine"
216
- MODEL_DERIVED_GENCLIENT = "ModelGeneratingClient"
217
- MODEL_ATTR_CLIENT_NAME = "ClientSpecificAttributeName"
218
- MODEL_ATTR_NAME = "AttributeName"
219
- MODEL_ATTR_VALUE = "AttributeValue"
220
- MODEL_ATTR_VALUEC = "AttributeValueC"
221
- MODEL_CLIENT_CLASS_KEY = "__class_name__"
222
- MODEL_INPUT_NROWS = "NRows"
223
- MODEL_INPUT_NCOLS = "NCols"
224
-
225
- MODEL_OBJ_NAME = "TableReferenceName"
226
- MODEL_OBJ_CLIENT_NAME = "ClientSpecificTableReferenceName"
227
- MODEL_OBJ_TABLE_NAME = "TableName"
228
-
229
- MODEL_INPUT_NAME = "InputName"
230
- MODEL_INPUT_CLIENT_NAME = "ClientSpecificInputName"
231
- MODEL_INPUT_TABLE_NAME = "TableName"
232
-
233
- MODEL_LIST_LIST = ['ModelName','ModelAlgorithm','ModelGeneratingEngine',
234
- 'ModelGeneratingClient','CreatedBy','CreatedDate']
235
-
236
- # Valid and default status and access
237
- MODEL_VALID_STATUS = ['ACTIVE', 'RETIRED', 'CANDIDATE', 'PRODUCTION', 'IN-DEVELOPMENT']
238
- DEFAULT_SAVE_STATUS = 'In-Development'
239
- DEFAULT_SAVE_ACCESS = 'Private'
240
- PUBLIC_ACCESS = 'Public'
241
192
 
242
193
  # Expected Prediction Types
243
194
  PREDICTION_TYPE_CLASSIFICATION = 'CLASSIFICATION'
@@ -477,12 +428,10 @@ class TableOperatorConstants(Enum):
477
428
  INDB_EXEC = "IN-DB"
478
429
  # Local execution mode.
479
430
  LOCAL_EXEC = "LOCAL"
480
- # Sandbox execution mode.
481
- SANDBOX_EXEC = "SANDBOX"
482
431
  # Remote user environment mode.
483
432
  REMOTE_EXEC = "REMOTE"
484
433
 
485
- EXEC_MODE = [LOCAL_EXEC, SANDBOX_EXEC, INDB_EXEC, REMOTE_EXEC]
434
+ EXEC_MODE = [LOCAL_EXEC, INDB_EXEC, REMOTE_EXEC]
486
435
  # map_row operation.
487
436
  MAP_ROW_OP = "map_row"
488
437
  # map_partition operation.
@@ -1283,7 +1232,6 @@ class SQLFunctionConstants(Enum):
1283
1232
  "sign": "SIGN",
1284
1233
  "signum": "SIGN",
1285
1234
  "sqrt": "SQRT",
1286
- "trunc": "TRUNC",
1287
1235
  "width_bucket": "WIDTH_BUCKET",
1288
1236
  "zeroifnull": "ZEROIFNULL",
1289
1237
 
@@ -1310,7 +1258,6 @@ class SQLFunctionConstants(Enum):
1310
1258
  "nvp": "NVP",
1311
1259
  "oreplace": "OREPLACE",
1312
1260
  "otranslate": "OTRANSLATE",
1313
- "replace": "OREPLACE",
1314
1261
  "reverse": "REVERSE",
1315
1262
  "right": "RIGHT",
1316
1263
  "rpad": "RPAD",
@@ -1339,13 +1286,58 @@ class SQLFunctionConstants(Enum):
1339
1286
  "shiftleft": "SHIFTLEFT",
1340
1287
  "shiftright": "SHIFTRIGHT",
1341
1288
  "subbitstr": "SUBBITSTR",
1342
- "to_byte": "TO_BYTE",
1343
1289
 
1344
1290
  # Regular Expression Functions
1345
1291
  "regexp_instr": "REGEXP_INSTR",
1346
1292
  "regexp_replace": "REGEXP_REPLACE",
1347
1293
  "regexp_similar": "REGEXP_SIMILAR",
1348
- "regexp_substr": "REGEXP_SUBSTR"
1294
+ "regexp_substr": "REGEXP_SUBSTR",
1295
+
1296
+ # DateTime Functions
1297
+ 'week_begin': 'td_week_begin',
1298
+ 'week_start': 'td_week_begin',
1299
+ 'week_end': 'td_week_end',
1300
+ 'quarter_begin': 'td_quarter_begin',
1301
+ 'quarter_start': 'td_quarter_begin',
1302
+ 'quarter_end': 'td_quarter_end',
1303
+ 'month_begin': 'td_month_begin',
1304
+ 'month_start': 'td_month_begin',
1305
+ 'month_end': 'td_month_end',
1306
+ 'year_begin': 'td_year_begin',
1307
+ 'year_start': 'td_year_begin',
1308
+ 'year_end': 'td_year_end',
1309
+ 'last_sunday': 'td_sunday',
1310
+ 'last_monday': 'td_monday',
1311
+ 'last_tuesday': 'td_tuesday',
1312
+ 'last_wednesday': 'td_wednesday',
1313
+ 'last_thursday': 'td_thursday',
1314
+ 'last_friday': 'td_friday',
1315
+ 'last_saturday': 'td_saturday',
1316
+ 'day_of_week': 'DayNumber_Of_Week',
1317
+ 'day_of_month': 'DayNumber_Of_Month',
1318
+ 'day_of_year': 'DayNumber_Of_Year',
1319
+ 'day_of_calendar': 'DayNumber_Of_Calendar',
1320
+ 'week_of_month': 'WeekNumber_Of_Month',
1321
+ 'week_of_quarter': 'WeekNumber_Of_Quarter',
1322
+ 'week_of_year': 'WeekNumber_Of_Year',
1323
+ 'week_of_calendar': 'WeekNumber_Of_Calendar',
1324
+ 'month_of_year': 'MonthNumber_Of_Year',
1325
+ 'month_of_calendar': 'MonthNumber_Of_Calendar',
1326
+ 'month_of_quarter': 'MonthNumber_Of_Quarter',
1327
+ 'quarter_of_year': 'QuarterNumber_Of_Year',
1328
+ 'quarter_of_calendar': 'QuarterNumber_Of_Calendar',
1329
+ 'year_of_calendar': 'YearNumber_Of_Calendar',
1330
+ 'day_occurrence_of_month': 'DayOccurrence_Of_Month',
1331
+ 'year': 'year',
1332
+ 'month': 'month',
1333
+ 'hour': 'hour',
1334
+ 'minute': 'minute',
1335
+ 'second': 'second',
1336
+ 'week': 'week',
1337
+ 'next_day': 'next_day',
1338
+ 'months_between': 'months_between',
1339
+ 'add_months': 'add_months',
1340
+ 'oadd_months': 'oadd_months'
1349
1341
  }
1350
1342
 
1351
1343
 
@@ -0,0 +1,160 @@
1
+ import warnings
2
+ from functools import wraps
3
+
4
+
5
+ def package_deprecation(version, replacement=None, type="class"):
6
+ """
7
+ Define a deprecation decorator.
8
+
9
+ PARAMETERS:
10
+ replacement:
11
+ Optional Argument.
12
+ `replacement` should refer to the new API to be used instead.
13
+
14
+ type:
15
+ Optional Argument.
16
+ Specifies the type of entity being deprecated.
17
+ For example,
18
+ class or function
19
+
20
+ EXAMPLES:
21
+ @package_deprecation('16.20.x.y')
22
+ def old_func(): ...
23
+ @package_deprecation('16.20.x.y', 'teradataml.analytics.mle')
24
+ def old_func(): ..."""
25
+
26
+ def decorator(func):
27
+ def wrapper(*args, **kwargs):
28
+ msg = "\nThe \"{}\" {} has moved to a new package in version {}."
29
+ if replacement:
30
+ msg += "\nImport from the teradataml package, or directly from the {} module." + \
31
+ "\nSee the teradataml {} User Guide for more information."
32
+ warnings.warn(msg.format('.'.join([func.__module__, func.__name__]), type, version,
33
+ replacement + '.' + func.__name__, version),
34
+ category=DeprecationWarning, stacklevel=2)
35
+ return func(*args, **kwargs)
36
+
37
+ return wraps(func)(wrapper)
38
+
39
+ return decorator
40
+
41
+
42
+ def argument_deprecation(tdml_version, deprecated_arguments, behaviour=False, alternatives=None):
43
+ """
44
+ Decorator for deprecating of argument(s) for a function or class constructor.
45
+
46
+ PARAMETERS:
47
+ tdml_version:
48
+ Required Argument.
49
+ Specifies the teradataml version when the argument will be deprecated.
50
+ Types: str
51
+
52
+ deprecated_arguments:
53
+ Required Argument.
54
+ Specifies the name(s) of the argument(s) to be deprecated.
55
+ Types: str OR list of Strings (str)
56
+
57
+ behaviour:
58
+ Optional Argument.
59
+ Specifies whether behaviour of the argument is deprecated.
60
+ Types: bool
61
+
62
+ alternatives:
63
+ Optional Argument.
64
+ Specifies the name(s) of the argument(s) that are alternative
65
+ to the deprecate arguments.
66
+ Types: str OR list of Strings (str)
67
+
68
+
69
+ EXAMPLES:
70
+ # Example 1: Deprecate behavior of arguments "arg1" and "arg2".
71
+ @argument_deprecation("17.20.00.02", ["arg1", "arg2"], True)
72
+ def old_func(self): ...
73
+
74
+ # Example 2: Deprecate argument completely.
75
+ @argument_deprecation("17.20.00.02", "old_arg")
76
+ def old_func(self): ...
77
+
78
+ # Example 3: Deprecate arguments completely with alternative.
79
+ @argument_deprecation("17.20.00.02", ["arg1", "arg2"], False, ["new_arg"])
80
+ def old_func(self): ...
81
+
82
+ # Example 4: Deprecate behavior of arguments "old_arg1" and "old_arg2" and provide alternatives.
83
+ @argument_deprecation("17.20.00.02", ["arg1", "arg2"], True, ["alt_arg1", "alt_arg2"])
84
+ def old_func(self): ...
85
+
86
+ """
87
+
88
+ def decorator(func):
89
+ def wrapper(*args, **kwargs):
90
+ msg = "\nThe argument(s) \"{}\" will be deprecated in {}."
91
+ if behaviour:
92
+ msg = "\nBehaviour of the argument(s) \"{}\" will change in {}."
93
+ msg = msg.format(deprecated_arguments, tdml_version)
94
+ if alternatives is not None:
95
+ msg += "\nUse argument(s) \"{}\" instead.".format(alternatives)
96
+ warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
97
+ return func(*args, **kwargs)
98
+
99
+ return wraps(func)(wrapper)
100
+
101
+ return decorator
102
+
103
+
104
+ def function_deprecation(tdml_version, behaviour=False, alternatives=None):
105
+ """
106
+ Decorator for deprecating a function.
107
+
108
+ PARAMETERS:
109
+ tdml_version:
110
+ Required Argument.
111
+ Specifies the teradataml version when the function will be deprecated.
112
+ Types: str
113
+
114
+ behaviour:
115
+ Optional Argument.
116
+ Specifies whether behaviour of the function is deprecated.
117
+ Default value: False
118
+ Types: bool
119
+
120
+
121
+ alternatives:
122
+ Optional Argument.
123
+ Specifies the name of the function that is alternative
124
+ to the deprecate function.
125
+ Default value: None
126
+ Types: str
127
+
128
+
129
+ EXAMPLES:
130
+ # Example 1: Deprecate behavior of function "old_func".
131
+ @function_deprecation("17.20.00.03", True)
132
+ def old_func(self): ...
133
+
134
+ # Example 2: Deprecate function "old_func" completely.
135
+ @function_deprecation("17.20.00.03")
136
+ def old_func(self): ...
137
+
138
+ # Example 3: Deprecate function "old_func" completely with alternative function "new_func".
139
+ @function_deprecation("17.20.00.03", False, "new_func")
140
+ def old_func(self): ...
141
+
142
+ # Example 4: Deprecate behavior of function "old_func".
143
+ @function_deprecation("17.20.00.03", True)
144
+ def old_func(self): ...
145
+ """
146
+
147
+ def decorator(func):
148
+ def wrapper(*args, **kwargs):
149
+ msg = "\nThe function \"{}\" will be deprecated in {}."
150
+ if behaviour:
151
+ msg = "\nBehaviour of the function \"{}\" will change in {}."
152
+ msg = msg.format(func.__name__, tdml_version)
153
+ if alternatives is not None:
154
+ msg += "\nInstead, Use following function \"{}\".".format(alternatives)
155
+ warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
156
+ return func(*args, **kwargs)
157
+
158
+ return wraps(func)(wrapper)
159
+
160
+ return decorator
@@ -34,8 +34,7 @@ class GarbageCollector():
34
34
  """
35
35
  The class has functionality to add temporary tables/views/scripts/container to
36
36
  garbage collection, so that they can be dropped when connection is disconnected/lost.
37
- Writes to a output file where the database name & table/view/script names and sandbox
38
- container id are persisted.
37
+ Writes to a output file where the database name & table/view/script names are persisted.
39
38
  """
40
39
  __garbage_persistent_file_name = getpass.getuser() + "_garbagecollect.info"
41
40
  __garbagecollector_folder_name = '.teradataml'
@@ -45,6 +44,7 @@ class GarbageCollector():
45
44
  __gc_views = []
46
45
  __gc_scripts = []
47
46
  __gc_container = []
47
+ __gc_apply = []
48
48
 
49
49
  @staticmethod
50
50
  def _get_temp_dir_name():
@@ -127,6 +127,8 @@ class GarbageCollector():
127
127
  GarbageCollector.__gc_views.append(object_name)
128
128
  elif object_type == TeradataConstants.CONTAINER:
129
129
  GarbageCollector.__gc_container.append(object_name)
130
+ elif object_type == TeradataConstants.TERADATA_APPLY:
131
+ GarbageCollector.__gc_apply.append(object_name)
130
132
  else:
131
133
  GarbageCollector.__gc_scripts.append(object_name)
132
134
 
@@ -158,11 +160,10 @@ class GarbageCollector():
158
160
  err_msg = "{}Failed to cleanup following views: {}\n".format(err_msg, str(GarbageCollector.__gc_views))
159
161
  raise_error = True
160
162
  if len(GarbageCollector.__gc_scripts) != 0:
161
- err_msg = "{}Failed to cleanup following scripts: {}\n".format(err_msg, str(GarbageCollector.__gc_scripts))
163
+ err_msg = "{}Failed to cleanup following STO scripts: {}\n".format(err_msg, str(GarbageCollector.__gc_scripts))
162
164
  raise_error = True
163
- if len(GarbageCollector.__gc_container) != 0:
164
- err_msg = "{}Failed to cleanup sandbox container: {}\n". \
165
- format(err_msg, GarbageCollector.__gc_container)
165
+ if len(GarbageCollector.__gc_apply) != 0:
166
+ err_msg = "{}Failed to cleanup following OpenAF scripts: {}\n".format(err_msg, str(GarbageCollector.__gc_apply))
166
167
  raise_error = True
167
168
  if raise_error:
168
169
  raise RuntimeError(err_msg)
@@ -179,6 +180,9 @@ class GarbageCollector():
179
180
  Required Argument.
180
181
  Name of the temporary table/view/script along with database name, container.
181
182
  that needs to be garbage collected.
183
+ Note:
184
+ If "object_type" is TeradataConstants.TERADATA_APPLY, then the format of
185
+ "object_name" should be <user_env_name(str)>::<apply_script_name>.
182
186
  Types: str
183
187
 
184
188
  object_type:
@@ -200,18 +204,7 @@ class GarbageCollector():
200
204
  try:
201
205
  tempfilename = GarbageCollector.__make_temp_file_name()
202
206
  writecontent = str(GarbageCollector.__version) + "," + str(os.getpid())
203
- if object_type == TeradataConstants.TERADATA_TABLE:
204
- writecontent += "," + str(TeradataConstants.TERADATA_TABLE.value)
205
- elif object_type == TeradataConstants.TERADATA_VIEW:
206
- writecontent += "," + str(TeradataConstants.TERADATA_VIEW.value)
207
- elif object_type == TeradataConstants.TERADATA_TEXT_FILE:
208
- writecontent += "," + str(TeradataConstants.TERADATA_TEXT_FILE.value)
209
- elif object_type == TeradataConstants.TERADATA_LOCAL_SCRIPT:
210
- writecontent += "," + str(TeradataConstants.TERADATA_LOCAL_SCRIPT.value)
211
- elif object_type == TeradataConstants.CONTAINER:
212
- writecontent += "," + str(TeradataConstants.CONTAINER.value)
213
- else:
214
- writecontent += "," + str(TeradataConstants.TERADATA_SCRIPT.value)
207
+ writecontent += "," + str(object_type.value)
215
208
  writecontent += "," + object_name + "\n"
216
209
  with open(tempfilename, 'a+') as fgc:
217
210
  fgc.write(writecontent)
@@ -267,7 +260,7 @@ class GarbageCollector():
267
260
  fgc.close()
268
261
 
269
262
  @staticmethod
270
- def __delete_gc_tempdir_local_file(db_object, file_extension='py'):
263
+ def __delete_gc_tempdir_local_file(db_object, object_type=TeradataConstants.TERADATA_TABLE):
271
264
  """
272
265
  DESCRIPTION:
273
266
  Creates path to the file in temp directory on client machine
@@ -279,11 +272,11 @@ class GarbageCollector():
279
272
  Specifies the name of the file/script to be deleted.
280
273
  Types: str
281
274
 
282
- file_extension:
275
+ object_type:
283
276
  Optional Argument.
284
- Specifies extension of the file.
285
- Default Value: 'py'
286
- Types: str
277
+ Specifies the type of the object (table/view/script) to be deleted.
278
+ Default Value: TeradataConstants.TERADATA_TABLE
279
+ Types: TeradataConstants
287
280
 
288
281
  RETURNS:
289
282
  None.
@@ -293,16 +286,21 @@ class GarbageCollector():
293
286
 
294
287
  EXAMPLES:
295
288
  GarbageCollector.__delete_gc_tempdir_local_file(
296
- 'ALICE.ml__script_executor__<uniqueID>','py')
289
+ 'ALICE.ml__script_executor__<uniqueID>.py', TeradataConstants.TERADATA_TABLE)
297
290
  """
298
291
  try:
299
292
  tempdir = GarbageCollector._get_temp_dir_name()
300
293
  script_alias = tdmlutil.utils.UtilFuncs._teradata_unquote_arg(
301
294
  tdmlutil.utils.UtilFuncs._extract_table_name(db_object), quote='"')
302
295
 
296
+ if object_type == TeradataConstants.TERADATA_APPLY.value:
297
+ # Apply script is stored in the format <user_env_name>::<apply_script_name>.
298
+ _, script_file = script_alias.split("::")
299
+ script_alias = script_file
300
+
303
301
  # Currently assumed that the file name will be '<UIF_ID>.py'.
304
302
  # That is how the scripts will be created and installed from teradataml.
305
- file_name = os.path.join(tempdir, '{}.{}'.format(script_alias, file_extension))
303
+ file_name = os.path.join(tempdir, script_alias)
306
304
  GarbageCollector._delete_local_file(file_name)
307
305
  except Exception as e:
308
306
  raise
@@ -333,7 +331,8 @@ class GarbageCollector():
333
331
  Specifies whether to delete the entry from one of the following:
334
332
  * __gc_tables - list of tables created
335
333
  * __gc_views - list of views created
336
- * __gc_scripts - list of scripts installed
334
+ * __gc_scripts - list of STO scripts installed
335
+ * __gc_apply - list of OpenAF scripts installed
337
336
  When set to True, the entry is removed from the appropriate list.
338
337
  This argument comes in handy for the GC validation to
339
338
  make sure that all intended tables/views/scripts are dropped by GC.
@@ -378,12 +377,12 @@ class GarbageCollector():
378
377
  object_type)
379
378
 
380
379
  # If object is a script, also delete the local copy of the file.
381
- if object_type == TeradataConstants.TERADATA_SCRIPT:
382
- GarbageCollector.__delete_gc_tempdir_local_file(db_object, "py")
383
- elif object_type == TeradataConstants.TERADATA_TEXT_FILE:
384
- GarbageCollector.__delete_gc_tempdir_local_file(db_object, "txt")
385
- elif object_type == TeradataConstants.TERADATA_LOCAL_SCRIPT:
386
- GarbageCollector.__delete_gc_tempdir_local_file(db_object, "py")
380
+ if object_type in \
381
+ [TeradataConstants.TERADATA_SCRIPT,
382
+ TeradataConstants.TERADATA_APPLY,
383
+ TeradataConstants.TERADATA_TEXT_FILE,
384
+ TeradataConstants.TERADATA_LOCAL_SCRIPT]:
385
+ GarbageCollector.__delete_gc_tempdir_local_file(db_object, object_type)
387
386
  fgc.truncate()
388
387
  except Exception as e:
389
388
  raise
@@ -436,6 +435,8 @@ class GarbageCollector():
436
435
  GarbageCollector.__gc_views.remove(object_name)
437
436
  elif TeradataConstants.CONTAINER == object_type:
438
437
  GarbageCollector.__gc_container.remove(object_name)
438
+ elif TeradataConstants.TERADATA_APPLY == object_type:
439
+ GarbageCollector.__gc_apply.remove(object_name)
439
440
  else:
440
441
  GarbageCollector.__gc_scripts.remove(object_name)
441
442
 
@@ -465,54 +466,6 @@ class GarbageCollector():
465
466
  except:
466
467
  pass
467
468
 
468
- @staticmethod
469
- def __delete_docker_sandbox_env(sandbox_env_object):
470
- """
471
- DESCRIPTION:
472
- Function to delete the specified sandbox container.
473
-
474
- PARAMETERS:
475
- sandbox_env_object:
476
- Required Argument.
477
- Specifies a string containing container id or '|' separated container id and image name
478
- that needs to be cleaned up.
479
- Types: str
480
-
481
- RETURNS:
482
- None.
483
-
484
- RAISES:
485
- docker.errors.NotFound, docker.errors.APIError.
486
-
487
- EXAMPLES:
488
- GarbageCollector.__delete_docker_sandbox_env(sandbox_env_object = '7efjglkfl'|'stoimage1').
489
- GarbageCollector.__delete_docker_sandbox_env(sandbox_env_object = '7efjglkfl').
490
- """
491
- import docker
492
- client = docker.APIClient()
493
- try:
494
- # Splitting it with '|' as most often image names doesn't contain it.
495
- res = sandbox_env_object.split('|')
496
- # Stop and remove the container using the container id, i.e., the first element in 'res'.
497
- client.stop(res[0])
498
- client.remove_container(res[0])
499
- if len(res) == 2:
500
- # Remove the image using the using image name, i.e., the second element in 'res'.
501
- client.remove_image(res[1])
502
- except docker.errors.NotFound as err1:
503
- raise err1
504
- except docker.errors.APIError as err2:
505
- raise err2
506
- except Exception as err3:
507
- raise err3
508
- finally:
509
- client.close()
510
- # Reset configuration parameters "sandbox_container_id" and
511
- # "_container_started_by_teradataml" after raising exceptions if any.
512
- configure._container_started_by_teradataml = None
513
- if configure.sandbox_container_id == res[0]:
514
- configure.sandbox_container_id = None
515
-
516
469
  @staticmethod
517
470
  def _cleanup_garbage_collector():
518
471
  """
@@ -561,45 +514,38 @@ class GarbageCollector():
561
514
  database_object = recordparts[3].strip()
562
515
 
563
516
  # Create the TeradataConstant to use with __delete_object_from_gc_list().
564
- object_type_enum = TeradataConstants.TERADATA_SCRIPT
565
- if object_type == TeradataConstants.TERADATA_TABLE.value:
566
- object_type_enum = TeradataConstants.TERADATA_TABLE
567
- elif object_type == TeradataConstants.TERADATA_VIEW.value:
568
- object_type_enum = TeradataConstants.TERADATA_VIEW
569
- elif object_type == TeradataConstants.TERADATA_TEXT_FILE.value:
570
- object_type_enum = TeradataConstants.TERADATA_TEXT_FILE
571
- elif object_type == TeradataConstants.TERADATA_LOCAL_SCRIPT.value:
572
- object_type_enum = TeradataConstants.TERADATA_LOCAL_SCRIPT
573
- elif object_type == TeradataConstants.CONTAINER.value:
574
- object_type_enum = TeradataConstants.CONTAINER
517
+ object_type_enum = TeradataConstants(object_type)
518
+
575
519
  try:
576
520
  # Drop the table/view/script/container based on database object type retrieved from the collector file.
577
521
  # # Drop table.
578
522
  if TeradataConstants.TERADATA_TABLE.value == object_type:
579
523
  tdmlutil.utils.UtilFuncs._drop_table(database_object,
580
524
  check_table_exist=False)
525
+
581
526
  # # Drop view.
582
527
  elif TeradataConstants.TERADATA_VIEW.value == object_type:
583
528
  tdmlutil.utils.UtilFuncs._drop_view(database_object,
584
529
  check_view_exist=False)
585
530
 
586
- elif TeradataConstants.TERADATA_TEXT_FILE.value == object_type:
587
- GarbageCollector.__delete_gc_tempdir_local_file(database_object, "txt")
531
+ elif object_type in [TeradataConstants.TERADATA_LOCAL_SCRIPT.value,
532
+ TeradataConstants.TERADATA_TEXT_FILE.value]:
533
+ GarbageCollector.__delete_gc_tempdir_local_file(database_object, object_type)
588
534
 
589
- # Drop script executor python file generated while
590
- # running Script
591
- elif TeradataConstants.TERADATA_LOCAL_SCRIPT.value == object_type:
592
- GarbageCollector.__delete_gc_tempdir_local_file(database_object, "py")
535
+ # # Drop Apply script.
536
+ elif TeradataConstants.TERADATA_APPLY.value == object_type:
537
+ tdmlutil.utils.UtilFuncs._delete_script(database_object,
538
+ file_type=object_type_enum)
539
+ # Delete the script locally
540
+ GarbageCollector.__delete_gc_tempdir_local_file(database_object, object_type)
593
541
 
594
- # Remove sandbox container.
595
- elif TeradataConstants.CONTAINER.value == object_type:
596
- GarbageCollector.__delete_docker_sandbox_env(database_object)
597
- # # Drop script.
542
+ # # Drop STO script.
598
543
  else:
599
544
  tdmlutil.utils.UtilFuncs._delete_script(database_object,
545
+ file_type=object_type_enum,
600
546
  check_script_exist=False)
601
547
  # Delete the script locally
602
- GarbageCollector.__delete_gc_tempdir_local_file(database_object, "py")
548
+ GarbageCollector.__delete_gc_tempdir_local_file(database_object, object_type)
603
549
 
604
550
  # Finally, delete the entry from gc lists if required.
605
551
  GarbageCollector.__delete_object_from_gc_list(database_object,
@@ -619,12 +565,23 @@ class GarbageCollector():
619
565
  # Delete entry from gc lists of required.
620
566
  GarbageCollector.__delete_object_from_gc_list(database_object,
621
567
  object_type_enum)
568
+ except (TeradataMlException, RuntimeError) as err:
569
+ if "Failed to execute get_env" in str(err) or \
570
+ "Failed to execute remove_file" in str(err):
571
+ # For removing files in OpenAF environment.
572
+ GarbageCollector.__deleterow(contentrecord)
573
+ # Delete entry from gc lists of required.
574
+ GarbageCollector.__delete_object_from_gc_list(database_object,
575
+ object_type_enum)
622
576
  except FileNotFoundError:
623
577
  # This will occur only when the item being deleted is a file,
624
578
  # and it's local copy is not found.
625
579
  GarbageCollector.__deleterow(contentrecord)
626
- GarbageCollector.__gc_scripts.remove(database_object)
627
- except Exception:
580
+ if object_type == TeradataConstants.TERADATA_APPLY:
581
+ GarbageCollector.__gc_apply.remove(database_object)
582
+ elif object_type == TeradataConstants.TERADATA_SCRIPT:
583
+ GarbageCollector.__gc_scripts.remove(database_object)
584
+ except Exception as err:
628
585
  pass
629
586
  # logger.error(Messages.get_message(MessageCodes.TDMLDF_DELETE_GARBAGE_COLLECTOR) + str(err))
630
587
  except Exception as e: