ga-api-client 0.2.9__tar.gz → 0.2.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ga-api-client
3
- Version: 0.2.9
3
+ Version: 0.2.12
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: License :: OSI Approved :: MIT License
6
6
  Classifier: Operating System :: OS Independent
@@ -161,6 +161,7 @@ class Client:
161
161
  retry_count += 1
162
162
  logging.warning(f'retry {retry_count}-th time')
163
163
  else:
164
+ logging.error(f'authentication fail {e.message}')
164
165
  raise e
165
166
  # send the request
166
167
  retry_count = 0
@@ -180,6 +181,14 @@ class Client:
180
181
  text = await resp.text()
181
182
  logging.debug(f'status={resp.status} message={text}')
182
183
  continue
184
+ elif resp.status == 500: # General error contain retry information
185
+ text = await resp.text()
186
+ if 'Warning' in text or 'Please try again' in text:
187
+ logging.debug(f'status={resp.status} message={text}')
188
+ continue
189
+ else:
190
+ logging.error(f'unexpected status={resp.status} message={text}')
191
+ raise UnexpectedStatus(resp.status, text)
183
192
  else:
184
193
  text = await resp.text()
185
194
  logging.error(f'unexpected status={resp.status} message={text}')
@@ -189,7 +198,7 @@ class Client:
189
198
  retry_count += 1
190
199
  logging.warning(f'{method} {path}, retry {retry_count}')
191
200
  else:
192
- logging.error(f'{method} {path} fail')
201
+ logging.error(f'{method} {path} fail {e.message}')
193
202
  raise e
194
203
 
195
204
  class System(Client):
@@ -34,10 +34,11 @@ class HyperLogLog:
34
34
  return f'h:{self._rmem.hex()}'
35
35
 
36
36
  def insert(self, hval):
37
- hval &= 0x7FFFF
38
- pos = hval >> 8 # 0..2047
39
- val = hval & 0xFF # 0..255
40
- self._rmem[pos] = max(val, self._rmem[pos])
37
+ hval &= 0xFFFFFFFF
38
+ pos = hval >> 21 # 0..2047
39
+ hval = (hval << 11) & 0xFFFFFFFF
40
+ val = 32 - hval.bit_length()
41
+ self._rmem[pos] |= 1 << val
41
42
 
42
43
  def value(self):
43
44
  N = 1 << 11
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ga-api-client
3
- Version: 0.2.9
3
+ Version: 0.2.12
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: License :: OSI Approved :: MIT License
6
6
  Classifier: Operating System :: OS Independent
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = ga-api-client
3
- version = 0.2.9
3
+ version = 0.2.12
4
4
  long_description = file: README.md
5
5
  long_description_content_type = text/markdown
6
6
  classifiers =
File without changes
File without changes
File without changes