Skip to content

Commit 3658ee8

Browse files
Hsaylorapaparazzi0329
authored andcommitted
fix(nlc): move deprecation warning
move deprecation warning to within initalizer block
1 parent d1ec209 commit 3658ee8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ibm_watson/natural_language_classifier_v1.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ class NaturalLanguageClassifierV1(BaseService):
4545
DEFAULT_SERVICE_URL = 'https://api.us-south.natural-language-classifier.watson.cloud.ibm.com'
4646
DEFAULT_SERVICE_NAME = 'natural_language_classifier'
4747

48+
print(
49+
"""
50+
On 9 August 2021, IBM announced the deprecation of the Natural Language Classifier service.
51+
The service will no longer be available from 8 August 2022. As of 9 September 2021, you will not be able to create new instances.
52+
Existing instances will be supported until 8 August 2022. Any instance that still exists on that date will be deleted.
53+
For more information, see https://cloud.ibm.com/docs/natural-language-classifier?topic=natural-language-classifier-migrating
54+
"""
55+
)
56+
4857
def __init__(
4958
self,
5059
authenticator: Authenticator = None,
@@ -84,15 +93,6 @@ def classify(self, classifier_id: str, text: str,
8493
:rtype: DetailedResponse with `dict` result representing a `Classification` object
8594
"""
8695

87-
print(
88-
"""
89-
On 9 August 2021, IBM announced the deprecation of the Natural Language Classifier service.
90-
The service will no longer be available from 8 August 2022. As of 9 September 2021, you will not be able to create new instances.
91-
Existing instances will be supported until 8 August 2022. Any instance that still exists on that date will be deleted.
92-
For more information, see https://cloud.ibm.com/docs/natural-language-classifier?topic=natural-language-classifier-migrating
93-
"""
94-
)
95-
9696
if classifier_id is None:
9797
raise ValueError('classifier_id must be provided')
9898
if text is None:

0 commit comments

Comments
 (0)