Skip to content

Commit

Permalink
Merge pull request #163 from cfrademan/development
Browse files Browse the repository at this point in the history
Object Store Blueprint #1
  • Loading branch information
Christiaan Rademan committed Aug 24, 2018
2 parents 5a620c7 + 2daa760 commit a465985
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion luxon/utils/http.py
Expand Up @@ -568,7 +568,7 @@ def request(client, method, url, params={},
_cache_engine = None

for kwarg in kwargs:
headers[kwarg] = kwargs
headers[kwarg] = kwargs[kwarg]

if data is not None:
if hasattr(data, 'json'):
Expand Down
6 changes: 6 additions & 0 deletions luxon/utils/sharding.py
Expand Up @@ -39,6 +39,7 @@

def shard(string):
hashed = 0
string = if_unicode_to_bytes(string)
for h in hashlib.md5(string).digest():
hashed += h

Expand Down Expand Up @@ -80,3 +81,8 @@ def __str__(self):
def __repr__(self):
return repr(self._partitions)

def __getitem__(self, item):
try:
return self._partitions[item]
except IndexError:
return []

0 comments on commit a465985

Please sign in to comment.