From faa9443d765ebd755c087e57d6e0d4f485ac3585 Mon Sep 17 00:00:00 2001 From: Paul-Louis NECH Date: Mon, 6 Nov 2017 11:09:53 +0100 Subject: [PATCH] fix(Client/Index/Transport): Make request_options optional (#306) --- algoliasearch/client.py | 2 +- algoliasearch/index.py | 2 +- algoliasearch/transport.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/algoliasearch/client.py b/algoliasearch/client.py index f4a71e77c..0b9d37a68 100644 --- a/algoliasearch/client.py +++ b/algoliasearch/client.py @@ -677,7 +677,7 @@ def is_alive(self, request_options=None): """ return self._req(True, '/1/isalive', 'GET', request_options) - def _req(self, is_search, path, meth, request_options, params=None, data=None): + def _req(self, is_search, path, meth, request_options=None, params=None, data=None): if len(self.api_key) > MAX_API_KEY_LENGTH: if data is None: data = {} diff --git a/algoliasearch/index.py b/algoliasearch/index.py index 11c6e2ba7..e36d91552 100644 --- a/algoliasearch/index.py +++ b/algoliasearch/index.py @@ -1130,7 +1130,7 @@ def search_rules(self, query=None, anchoring=None, context=None, page=None, hits return self._req(True, '/rules/search', 'POST', request_options, data=params) - def _req(self, is_search, path, meth, request_options, params=None, data=None): + def _req(self, is_search, path, meth, request_options=None, params=None, data=None): """Perform an HTTPS request with retry logic.""" path = '%s%s' % (self._request_path, path) return self.client._req(is_search, path, meth, request_options, params, data) diff --git a/algoliasearch/transport.py b/algoliasearch/transport.py index 400b7532c..3a9b4ef80 100644 --- a/algoliasearch/transport.py +++ b/algoliasearch/transport.py @@ -140,7 +140,7 @@ def _get_hosts(self, is_search): else: return self._original_write_hosts - def req(self, is_search, path, meth, params, data, request_options): + def req(self, is_search, path, meth, params, data, request_options=None): """Perform an HTTPS request with retry logic.""" # Merge params and request_options params.