Skip to content

Commit eefa9f3

Browse files
authored
Merge pull request #58 from merative/dla
fix: bump core to 3.16.0
2 parents 51e6f7c + 3ffe913 commit eefa9f3

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

ibm_whcs_sdk/annotator_for_clinical_data/annotator_for_clinical_data_v1.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from enum import Enum
2424
from typing import BinaryIO, Dict, List, TextIO, Union
2525
import json
26+
from warnings import warn
2627

2728
from ibm_cloud_sdk_core import BaseService, DetailedResponse, ApiException
2829
from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator
@@ -665,6 +666,7 @@ def delete_flows(self, id: str, **kwargs) -> DetailedResponse:
665666
#########################
666667

667668

669+
# Method is deprecated and could be removed in the future. Use 'analyze' method instead.
668670
def run_pipeline(self, *, unstructured: List['UnstructuredContainer'] = None, annotator_flows: List['AnnotatorFlow'] = None, debug_text_restore: bool = None, return_analyzed_text: bool = None, **kwargs) -> DetailedResponse:
669671
"""
670672
Detect entities & relations from unstructured data.
@@ -744,6 +746,8 @@ def run_pipeline(self, *, unstructured: List['UnstructuredContainer'] = None, an
744746
:rtype: DetailedResponse
745747
"""
746748

749+
warn("The 'run_pipeline' method is deprecated. Use 'analyze' method instead.", DeprecationWarning, stacklevel=2)
750+
747751
if unstructured is not None:
748752
unstructured = [ convert_model(x) for x in unstructured ]
749753
if annotator_flows is not None:
@@ -763,7 +767,7 @@ def run_pipeline(self, *, unstructured: List['UnstructuredContainer'] = None, an
763767
'annotatorFlows': annotator_flows
764768
}
765769
data = {k: v for (k, v) in data.items() if v is not None}
766-
data = json.dumps(data)
770+
data = json.dumps(data, cls=AnnotatorEncoder)
767771
headers['content-type'] = 'application/json'
768772

769773
if 'headers' in kwargs:
@@ -895,6 +899,7 @@ def analyze(self, text, flow, **kwargs):
895899
return result
896900

897901

902+
# Method is deprecated and could be removed in the future. Use 'analyze_with_flow' instead.
898903
def run_pipeline_with_flow(self, flow_id: str, return_analyzed_text: bool, analytic_flow_bean_input: Union['AnalyticFlowBeanInput', str, TextIO], *, content_type: str = None, debug_text_restore: bool = None, **kwargs) -> DetailedResponse:
899904
"""
900905
analyze with a pre-specified flow.
@@ -932,6 +937,9 @@ def run_pipeline_with_flow(self, flow_id: str, return_analyzed_text: bool, analy
932937
:rtype: DetailedResponse
933938
"""
934939

940+
# Method is deprecated and could be removed in the future.
941+
warn("The 'run_pipeline_with_flow' method is deprecated. Use 'analyze_with_flow' method instead.", DeprecationWarning, stacklevel=2)
942+
935943
if flow_id is None:
936944
raise ValueError('flow_id must be provided')
937945
if return_analyzed_text is None:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
requests>=2.24.0,<3.0
22
python_dateutil>=2.5.3,<3.0.0
3-
ibm_cloud_sdk_core==3.13.0,<4.0.0
3+
ibm_cloud_sdk_core==3.16.0,<4.0.0

0 commit comments

Comments
 (0)