Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion volcengine/base/Request.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding : utf-8
from collections import OrderedDict
import warnings

try:
from urllib import urlencode
Expand All @@ -20,9 +21,22 @@ def __init__(self):
self.connection_timeout = 0
self.socket_timeout = 0

def set_shema(self, schema):
def set_schema(self, schema):
self.schema = schema

def set_shema(self, schema):
"""
Deprecated: Use set_schema() instead.
This method will be removed in a future version.
"""
warnings.warn(
"set_shema() is deprecated due to a typo and will be removed in a future version. "
"Use set_schema() instead.",
DeprecationWarning,
stacklevel=2
)
self.set_schema(schema)

def set_method(self, method):
self.method = method

Expand Down
4 changes: 2 additions & 2 deletions volcengine/base/Service.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_sign_url(self, api, params):

mquery = self.merge(api_info.query, params)
r = Request()
r.set_shema(self.service_info.scheme)
r.set_schema(self.service_info.scheme)
r.set_method(api_info.method)
r.set_path(api_info.path)
r.set_query(mquery)
Expand Down Expand Up @@ -225,7 +225,7 @@ def prepare_request(self, api_info, params, doseq=0):
socket_timeout = self.service_info.socket_timeout

r = Request()
r.set_shema(self.service_info.scheme)
r.set_schema(self.service_info.scheme)
r.set_method(api_info.method)
r.set_connection_timeout(connection_timeout)
r.set_socket_timeout(socket_timeout)
Expand Down