Skip to content

Commit

Permalink
fix(nlc): move deprecation warning
Browse files Browse the repository at this point in the history
move deprecation warning to within initalizer block
  • Loading branch information
Hsaylor authored and apaparazzi0329 committed Aug 26, 2021
1 parent d1ec209 commit 3658ee8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ibm_watson/natural_language_classifier_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ class NaturalLanguageClassifierV1(BaseService):
DEFAULT_SERVICE_URL = 'https://api.us-south.natural-language-classifier.watson.cloud.ibm.com'
DEFAULT_SERVICE_NAME = 'natural_language_classifier'

print(
"""
On 9 August 2021, IBM announced the deprecation of the Natural Language Classifier service.
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.
Existing instances will be supported until 8 August 2022. Any instance that still exists on that date will be deleted.
For more information, see https://cloud.ibm.com/docs/natural-language-classifier?topic=natural-language-classifier-migrating
"""
)

def __init__(
self,
authenticator: Authenticator = None,
Expand Down Expand Up @@ -84,15 +93,6 @@ def classify(self, classifier_id: str, text: str,
:rtype: DetailedResponse with `dict` result representing a `Classification` object
"""

print(
"""
On 9 August 2021, IBM announced the deprecation of the Natural Language Classifier service.
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.
Existing instances will be supported until 8 August 2022. Any instance that still exists on that date will be deleted.
For more information, see https://cloud.ibm.com/docs/natural-language-classifier?topic=natural-language-classifier-migrating
"""
)

if classifier_id is None:
raise ValueError('classifier_id must be provided')
if text is None:
Expand Down

0 comments on commit 3658ee8

Please sign in to comment.