Skip to content

Commit

Permalink
fix: bump core to 3.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dlangst committed Feb 9, 2023
1 parent 51e6f7c commit 3ffe913
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from enum import Enum
from typing import BinaryIO, Dict, List, TextIO, Union
import json
from warnings import warn

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


# Method is deprecated and could be removed in the future. Use 'analyze' method instead.
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:
"""
Detect entities & relations from unstructured data.
Expand Down Expand Up @@ -744,6 +746,8 @@ def run_pipeline(self, *, unstructured: List['UnstructuredContainer'] = None, an
:rtype: DetailedResponse
"""

warn("The 'run_pipeline' method is deprecated. Use 'analyze' method instead.", DeprecationWarning, stacklevel=2)

if unstructured is not None:
unstructured = [ convert_model(x) for x in unstructured ]
if annotator_flows is not None:
Expand All @@ -763,7 +767,7 @@ def run_pipeline(self, *, unstructured: List['UnstructuredContainer'] = None, an
'annotatorFlows': annotator_flows
}
data = {k: v for (k, v) in data.items() if v is not None}
data = json.dumps(data)
data = json.dumps(data, cls=AnnotatorEncoder)
headers['content-type'] = 'application/json'

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


# Method is deprecated and could be removed in the future. Use 'analyze_with_flow' instead.
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:
"""
analyze with a pre-specified flow.
Expand Down Expand Up @@ -932,6 +937,9 @@ def run_pipeline_with_flow(self, flow_id: str, return_analyzed_text: bool, analy
:rtype: DetailedResponse
"""

# Method is deprecated and could be removed in the future.
warn("The 'run_pipeline_with_flow' method is deprecated. Use 'analyze_with_flow' method instead.", DeprecationWarning, stacklevel=2)

if flow_id is None:
raise ValueError('flow_id must be provided')
if return_analyzed_text is None:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
requests>=2.24.0,<3.0
python_dateutil>=2.5.3,<3.0.0
ibm_cloud_sdk_core==3.13.0,<4.0.0
ibm_cloud_sdk_core==3.16.0,<4.0.0

0 comments on commit 3ffe913

Please sign in to comment.