ga-api-client 0.5.2__tar.gz → 0.5.4__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.
- {ga_api_client-0.5.2/ga_api_client.egg-info → ga_api_client-0.5.4}/PKG-INFO +1 -1
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/ga_api_client.py +18 -16
- {ga_api_client-0.5.2 → ga_api_client-0.5.4/ga_api_client.egg-info}/PKG-INFO +1 -1
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/setup.cfg +1 -1
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/LICENSE +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/README.md +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/__init__.py +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/average.py +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/capture.py +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/field_tree.py +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/hyper_log_log.py +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/rate.py +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/std.py +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api/tdigest.py +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api_client.egg-info/SOURCES.txt +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api_client.egg-info/dependency_links.txt +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api_client.egg-info/requires.txt +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/ga_api_client.egg-info/top_level.txt +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/pyproject.toml +0 -0
- {ga_api_client-0.5.2 → ga_api_client-0.5.4}/setup.py +0 -0
|
@@ -409,16 +409,18 @@ class Reader:
|
|
|
409
409
|
async def _exec(self, start, end):
|
|
410
410
|
start = _get_utc_timestamp(start)
|
|
411
411
|
end = _get_utc_timestamp(end)
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
412
|
+
pipeline = self.pipeline.copy()
|
|
413
|
+
if 'config' not in pipeline:
|
|
414
|
+
pipeline['config'] = {}
|
|
415
|
+
pipeline['config']['start'] = start
|
|
416
|
+
pipeline['config']['end'] = end
|
|
417
|
+
pipeline['config']['size'] = self.size
|
|
418
|
+
pipeline['config']['series'] = self.series
|
|
418
419
|
if self.fields is not None:
|
|
419
|
-
|
|
420
|
-
status, rlt = await self._client._request('POST', f'/record', [200],
|
|
421
|
-
|
|
420
|
+
pipeline['config']['fields'] = self.fields
|
|
421
|
+
status, rlt = await self._client._request('POST', f'/record', [200], pipeline, self.test_fn)
|
|
422
|
+
if status != 0:
|
|
423
|
+
logging.info(f'/record status={status} start={_logtime(start)} end={_logtime(end)} series={self.series}')
|
|
422
424
|
if rlt is not None and len(rlt) > 0:
|
|
423
425
|
self.count += len(rlt) - 1 # skip first row, which is header
|
|
424
426
|
return pd.DataFrame(rlt[1:], columns=rlt[0])
|
|
@@ -451,10 +453,9 @@ class Reader:
|
|
|
451
453
|
df = pd.concat([df, rlt], ignore_index=True, copy=False)
|
|
452
454
|
if len(df) >= self.size:
|
|
453
455
|
break
|
|
454
|
-
if self.fields is None:
|
|
455
|
-
return df.head(self.size)
|
|
456
|
-
else:
|
|
456
|
+
if self.fields is not None and len(df) != 0:
|
|
457
457
|
return df.head(self.size)[self.fields]
|
|
458
|
+
return df.head(self.size)
|
|
458
459
|
except Exception as e:
|
|
459
460
|
logging.error(f'execute record fail {e}')
|
|
460
461
|
for task in tasks:
|
|
@@ -657,7 +658,7 @@ def _compute_kcol_mcol(pipeline):
|
|
|
657
658
|
moper = []
|
|
658
659
|
if 'bucket' in pipeline:
|
|
659
660
|
for bkt in pipeline['bucket']:
|
|
660
|
-
if bkt[0] in ['$distinctTuple','enumTuple']:
|
|
661
|
+
if bkt[0] in ['$distinctTuple','$enumTuple', '$distinctTree']:
|
|
661
662
|
# each field introduce one key column
|
|
662
663
|
kcol += len(bkt[1]['fields'])
|
|
663
664
|
else:
|
|
@@ -704,9 +705,10 @@ class _translate_table:
|
|
|
704
705
|
output_row.append(tuple(elem))
|
|
705
706
|
else:
|
|
706
707
|
output_row.append(elem)
|
|
707
|
-
else:
|
|
708
|
-
moper_idx =
|
|
709
|
-
|
|
708
|
+
else: # metric
|
|
709
|
+
moper_idx = int((idx-self.kcol)/2)
|
|
710
|
+
moper = self.moper[moper_idx]
|
|
711
|
+
output_row.append(MOPER_MAP[moper](elem))
|
|
710
712
|
yield output_row
|
|
711
713
|
|
|
712
714
|
class _translate_rlts:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|