From 7bc5b7d14d4f2bb3377287257b2a448e349cfa0d Mon Sep 17 00:00:00 2001 From: Kaspar Lyngsie Date: Tue, 8 Sep 2020 14:35:52 +0200 Subject: [PATCH 1/6] PRED-4338 Updated README.rst --- README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.rst b/README.rst index ba307de..3778529 100644 --- a/README.rst +++ b/README.rst @@ -12,6 +12,11 @@ A script to score CSV files via DataRobot's prediction API. .. image:: https://badge.fury.io/py/datarobot-batch-scoring.svg :target: https://badge.fury.io/py/datarobot-batch-scoring +Deprecation Warning +======================= +he Batch Scoring script is deprecated. It will continue functioning indefinitely, +but it will not receive any new bug fixes and new functionality. +Please, use the [Batch Prediction command-line tools](https://app.datarobot.com/docs/predictions/batch/cli-scripts.html] instead. Version Compatibility --------------------- From cfc2ebb4f122f52a506c8063702a47f5fda6a322 Mon Sep 17 00:00:00 2001 From: Kaspar Lyngsie Date: Tue, 8 Sep 2020 14:40:50 +0200 Subject: [PATCH 2/6] PRED-4336 Added deprecation warning to setup.py --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 5943fbc..27ee2a5 100644 --- a/setup.py +++ b/setup.py @@ -83,3 +83,9 @@ def read_requirements_file(file): ], **extra ) + +print('{yellow}{bold}Deprecation Warning!{reset} ' + 'The Batch Scoring script is deprecated. It will continue functioning indefinitely, but it will not receive any' + ' new bug fixes and new functionality. Please, use the Batch Prediction command-line tools instead' + ' ({underline}https://app.datarobot.com/docs/predictions/batch/cli-scripts.html{reset}).' + .format(yellow='\033[93m', bold='\033[1m', reset='\033[0m', underline='\033[4m')) \ No newline at end of file From 834e6f5482b51ce16fc6f81fa65bf4abd08f1a09 Mon Sep 17 00:00:00 2001 From: Kaspar Lyngsie Date: Tue, 8 Sep 2020 14:46:01 +0200 Subject: [PATCH 3/6] PRED-4337 Added deprecation warning message to runtime --- datarobot_batch_scoring/consts.py | 7 +++++++ datarobot_batch_scoring/main.py | 6 +++++- setup.py | 8 +++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/datarobot_batch_scoring/consts.py b/datarobot_batch_scoring/consts.py index 49970b4..a45bf4b 100644 --- a/datarobot_batch_scoring/consts.py +++ b/datarobot_batch_scoring/consts.py @@ -6,6 +6,13 @@ REPORT_INTERVAL = 5 +DEPRECATION_WARNING = ( + '{yellow}{bold}Deprecation Warning!{reset} ' + 'The Batch Scoring script is deprecated. It will continue functioning indefinitely, but it will not receive any ' + 'new bug fixes and new functionality. Please, use the Batch Prediction command-line tools instead ' + '({underline}https://app.datarobot.com/docs/predictions/batch/cli-scripts.html{reset}).' + .format(yellow='\033[93m', bold='\033[1m', reset='\033[0m', underline='\033[4m') + ) class WriterQueueMsg(object): CTX_WARNING = 'CTX_WARNING' diff --git a/datarobot_batch_scoring/main.py b/datarobot_batch_scoring/main.py index 7b70ffc..454df45 100644 --- a/datarobot_batch_scoring/main.py +++ b/datarobot_batch_scoring/main.py @@ -10,6 +10,7 @@ from datarobot_batch_scoring.api_response_handlers import ( RESPONSE_HANDLERS, PRED_API_V10, API_V1) from datarobot_batch_scoring.batch_scoring import (run_batch_predictions) +from datarobot_batch_scoring.consts import DEPRECATION_WARNING from datarobot_batch_scoring.exceptions import ShelveError from datarobot_batch_scoring.utils import (UI, get_config_file, parse_config_file, @@ -38,7 +39,9 @@ $ batch_scoring --host https://example.orm.datarobot.com \ --user="" --password="" 5545eb20b4912911244d4835 \ 5545eb71b4912911244d4847 ~/Downloads/diabetes_test.csv -""" + + {deprecation_warning} +""".format(deprecation_warning=DEPRECATION_WARNING) VALID_DELIMITERS = {';', ',', '|', '\t', ' ', '!', ' '} @@ -519,5 +522,6 @@ def main_standalone(argv=sys.argv[1:]): if __name__ == '__main__': + print(DEPRECATION_WARNING) exit_code = main() # pragma: no cover sys.exit(exit_code) diff --git a/setup.py b/setup.py index 27ee2a5..1962d81 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,8 @@ import re from setuptools import setup, find_packages +from datarobot_batch_scoring.consts import DEPRECATION_WARNING + extra = {} def read_requirements_file(file): @@ -84,8 +86,4 @@ def read_requirements_file(file): **extra ) -print('{yellow}{bold}Deprecation Warning!{reset} ' - 'The Batch Scoring script is deprecated. It will continue functioning indefinitely, but it will not receive any' - ' new bug fixes and new functionality. Please, use the Batch Prediction command-line tools instead' - ' ({underline}https://app.datarobot.com/docs/predictions/batch/cli-scripts.html{reset}).' - .format(yellow='\033[93m', bold='\033[1m', reset='\033[0m', underline='\033[4m')) \ No newline at end of file +print(DEPRECATION_WARNING) \ No newline at end of file From 2e6cd4a51fc487e1468e28c8ea9e00d58f48b3ce Mon Sep 17 00:00:00 2001 From: Kaspar Lyngsie Date: Tue, 8 Sep 2020 14:51:32 +0200 Subject: [PATCH 4/6] Sorry, flake8 --- datarobot_batch_scoring/consts.py | 17 +++++++++++++---- datarobot_batch_scoring/main.py | 1 - 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/datarobot_batch_scoring/consts.py b/datarobot_batch_scoring/consts.py index a45bf4b..9dfb977 100644 --- a/datarobot_batch_scoring/consts.py +++ b/datarobot_batch_scoring/consts.py @@ -8,12 +8,21 @@ DEPRECATION_WARNING = ( '{yellow}{bold}Deprecation Warning!{reset} ' - 'The Batch Scoring script is deprecated. It will continue functioning indefinitely, but it will not receive any ' - 'new bug fixes and new functionality. Please, use the Batch Prediction command-line tools instead ' - '({underline}https://app.datarobot.com/docs/predictions/batch/cli-scripts.html{reset}).' - .format(yellow='\033[93m', bold='\033[1m', reset='\033[0m', underline='\033[4m') + 'The Batch Scoring script is deprecated. It will continue functioning ' + 'indefinitely, but it will not receive any new bug fixes and new ' + 'functionality. Please, use the Batch Prediction command-line tools ' + 'instead: ' + '({underline}https://app.datarobot.com/docs/predictions' + '/batch/cli-scripts.html{reset}).' + .format( + yellow='\033[93m', + bold='\033[1m', + reset='\033[0m', + underline='\033[4m' + ) ) + class WriterQueueMsg(object): CTX_WARNING = 'CTX_WARNING' CTX_ERROR = 'CTX_ERROR' diff --git a/datarobot_batch_scoring/main.py b/datarobot_batch_scoring/main.py index 454df45..dfaa26c 100644 --- a/datarobot_batch_scoring/main.py +++ b/datarobot_batch_scoring/main.py @@ -39,7 +39,6 @@ $ batch_scoring --host https://example.orm.datarobot.com \ --user="" --password="" 5545eb20b4912911244d4835 \ 5545eb71b4912911244d4847 ~/Downloads/diabetes_test.csv - {deprecation_warning} """.format(deprecation_warning=DEPRECATION_WARNING) From 7c1fad709612c784a1d117d4b692e2889df58246 Mon Sep 17 00:00:00 2001 From: Kaspar Lyngsie Date: Tue, 8 Sep 2020 14:55:17 +0200 Subject: [PATCH 5/6] Typo --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 3778529..bbd4136 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ A script to score CSV files via DataRobot's prediction API. Deprecation Warning ======================= -he Batch Scoring script is deprecated. It will continue functioning indefinitely, +The Batch Scoring script is deprecated. It will continue functioning indefinitely, but it will not receive any new bug fixes and new functionality. Please, use the [Batch Prediction command-line tools](https://app.datarobot.com/docs/predictions/batch/cli-scripts.html] instead. From 43476de7e06191471483b3949e5a983c4bbd16ed Mon Sep 17 00:00:00 2001 From: Kaspar Lyngsie Date: Tue, 8 Sep 2020 15:19:37 +0200 Subject: [PATCH 6/6] Fixing restructured text bug --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index bbd4136..cfab8ed 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ A script to score CSV files via DataRobot's prediction API. .. image:: https://badge.fury.io/py/datarobot-batch-scoring.svg :target: https://badge.fury.io/py/datarobot-batch-scoring -Deprecation Warning +Deprecation Notice ======================= The Batch Scoring script is deprecated. It will continue functioning indefinitely, but it will not receive any new bug fixes and new functionality.