Skip to content

Commit 2d0ada2

Browse files
Merge branch 'feature/integrate-circleci' of github.com:SlicingDice/slicingdice-python into feature/integrate-circleci
2 parents 7b993e8 + 608c1ad commit 2d0ada2

File tree

13 files changed

+45603
-139330
lines changed

13 files changed

+45603
-139330
lines changed

pyslicer/api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def status_code(self):
4545
def headers(self):
4646
return self.__headers
4747

48-
def _organize_keys(self, master_key, custom_key, read_key, write_key):
48+
@staticmethod
49+
def _organize_keys(master_key, custom_key, read_key, write_key):
4950
return {
5051
"master_key": master_key,
5152
"custom_key": custom_key,
@@ -130,7 +131,8 @@ def _handler_request(self, req):
130131
self._set_properties_values(sd_response)
131132
return sd_response.result
132133

133-
def _check_request(self, request):
134+
@staticmethod
135+
def _check_request(request):
134136
"""Check if the request was successful
135137
136138
Keyword arguments:

pyslicer/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def _data_extraction_wrapper(self, url, query):
125125
req_type="post",
126126
key_level=0)
127127

128-
def _wrapper_test(self, test):
128+
@staticmethod
129+
def _wrapper_test(test):
129130
base_url = SlicingDice.BASE_URL
130131
if test:
131132
base_url += "/test"

pyslicer/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def __init__(self, *args, **kwargs):
565565

566566
class QueryCountInvalidParameterErrorException(SlicingDiceException):
567567
def __init__(self, *args, **kwargs):
568-
super(QueryLevelLimitException, self).__init__(
568+
super(QueryCountInvalidParameterErrorException, self).__init__(
569569
self, *args, **kwargs)
570570

571571

pyslicer/url_resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ class URLResources(object):
1313
QUERY_TOP_VALUES = "/query/top_values/"
1414
QUERY_EXISTS_ENTITY = "/query/exists/entity/"
1515
QUERY_SAVED = "/query/saved/"
16-
QUERY_DATA_EXTRACTION_RESULT = "/query/data_extraction/result/"
17-
QUERY_DATA_EXTRACTION_SCORE = "/query/data_extraction/score/"
16+
QUERY_DATA_EXTRACTION_RESULT = "/data_extraction/result/"
17+
QUERY_DATA_EXTRACTION_SCORE = "/data_extraction/score/"

pyslicer/utils/validators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def __init__(self, queries):
138138
def _valid_keys(self):
139139
if "fields" in self.data:
140140
value = self.data["fields"]
141-
if type(value) != list:
141+
if not isinstance(value, list):
142142
raise exceptions.InvalidQueryException(
143143
"The key 'fields' in query has a invalid value.")
144144
else:
@@ -148,7 +148,7 @@ def _valid_keys(self):
148148
"have up to 10 fields.")
149149
if "limit" in self.data:
150150
limit = self.data['limit']
151-
if type(limit) != int:
151+
if not isinstance(limit, int):
152152
raise exceptions.InvalidQueryException(
153153
"The key 'limit' in query has a invalid value.")
154154
if limit > 100:
@@ -178,7 +178,7 @@ def _has_empty_field(self):
178178
if not all(self.data) or not all(self.data.values()):
179179
raise exceptions.InvalidIndexException(
180180
"This index has invalid keys or values.")
181-
for id, value in self.data.iteritems():
181+
for value in self.data.values():
182182
# Value is a dictionary when it is an entity being indexed:
183183
# "my-entity": {"year": 2016}
184184
# It can also be a parameter, such as "auto-create-fields":

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def read(fname):
77

88
setup(
99
name="pyslicer",
10-
version="0.1.1",
10+
version="1.0.0",
1111
author="SlicingDice LLC",
1212
author_email="help@slicingdice.com",
1313
description="Official Python client for SlicingDice, Data Warehouse and Analytics Database as a Service.",

0 commit comments

Comments
 (0)