garf-core 0.0.7__py3-none-any.whl → 0.0.8__py3-none-any.whl
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.
- garf_core/__init__.py +1 -1
- garf_core/report_fetcher.py +18 -11
- {garf_core-0.0.7.dist-info → garf_core-0.0.8.dist-info}/METADATA +1 -1
- {garf_core-0.0.7.dist-info → garf_core-0.0.8.dist-info}/RECORD +7 -7
- {garf_core-0.0.7.dist-info → garf_core-0.0.8.dist-info}/WHEEL +0 -0
- {garf_core-0.0.7.dist-info → garf_core-0.0.8.dist-info}/entry_points.txt +0 -0
- {garf_core-0.0.7.dist-info → garf_core-0.0.8.dist-info}/top_level.txt +0 -0
garf_core/__init__.py
CHANGED
garf_core/report_fetcher.py
CHANGED
@@ -38,12 +38,17 @@ class ApiReportFetcher:
|
|
38
38
|
|
39
39
|
Attributes:
|
40
40
|
api_client: a client used for connecting to API.
|
41
|
+
parser: Type of parser to convert API response.
|
42
|
+
query_specification_builder: Class to perform query parsing.
|
41
43
|
"""
|
42
44
|
|
43
45
|
def __init__(
|
44
46
|
self,
|
45
47
|
api_client: api_clients.BaseApiClient,
|
46
48
|
parser: parsers.BaseParser = parsers.ListParser,
|
49
|
+
query_specification_builder: query_editor.QuerySpecification = (
|
50
|
+
query_editor.QuerySpecification
|
51
|
+
),
|
47
52
|
**kwargs: str,
|
48
53
|
) -> None:
|
49
54
|
"""Instantiates ApiReportFetcher based on provided api client.
|
@@ -51,9 +56,11 @@ class ApiReportFetcher:
|
|
51
56
|
Args:
|
52
57
|
api_client: Instantiated api client.
|
53
58
|
parser: Type of parser to convert API response.
|
59
|
+
query_specification_builder: Class to perform query parsing.
|
54
60
|
"""
|
55
61
|
self.api_client = api_client
|
56
62
|
self.parser = parser()
|
63
|
+
self.query_specification_builder = query_specification_builder
|
57
64
|
self.query_args = kwargs
|
58
65
|
|
59
66
|
async def afetch(
|
@@ -65,12 +72,12 @@ class ApiReportFetcher:
|
|
65
72
|
"""Asynchronously fetches data from API based on query_specification.
|
66
73
|
|
67
74
|
Args:
|
68
|
-
|
69
|
-
|
70
|
-
|
75
|
+
query_specification: Query text that will be passed to API
|
76
|
+
alongside column_names, customizers and virtual columns.
|
77
|
+
args: Arguments that need to be passed to the query.
|
71
78
|
|
72
79
|
Returns:
|
73
|
-
|
80
|
+
GarfReport with results of query execution.
|
74
81
|
"""
|
75
82
|
return self.fetch(query_specification, args, **kwargs)
|
76
83
|
|
@@ -83,19 +90,19 @@ class ApiReportFetcher:
|
|
83
90
|
"""Fetches data from API based on query_specification.
|
84
91
|
|
85
92
|
Args:
|
86
|
-
|
87
|
-
|
88
|
-
|
93
|
+
query_specification: Query text that will be passed to API
|
94
|
+
alongside column_names, customizers and virtual columns.
|
95
|
+
args: Arguments that need to be passed to the query.
|
89
96
|
|
90
97
|
Returns:
|
91
|
-
|
98
|
+
GarfReport with results of query execution.
|
92
99
|
|
93
100
|
Raises:
|
94
|
-
|
95
|
-
|
101
|
+
GarfExecutorException:
|
102
|
+
When customer_ids are not provided or API returned error.
|
96
103
|
"""
|
97
104
|
if not isinstance(query_specification, query_editor.QuerySpecification):
|
98
|
-
query_specification =
|
105
|
+
query_specification = self.query_specification_builder(
|
99
106
|
text=str(query_specification),
|
100
107
|
args=args,
|
101
108
|
)
|
@@ -1,13 +1,13 @@
|
|
1
|
-
garf_core/__init__.py,sha256
|
1
|
+
garf_core/__init__.py,sha256=-2NI7Qm5ndrlcaz3itBBuFXOKu4anul2TdJro2G5oRo,598
|
2
2
|
garf_core/api_clients.py,sha256=FKmwts_QBV_E4aTmrnsZtow0CmSExLibfeSkMSrudU0,2235
|
3
3
|
garf_core/base_query.py,sha256=uEhKP56wcFtMiSwYOxoZ0q7OEvURGVOeRdpSYjxWLho,1201
|
4
4
|
garf_core/exceptions.py,sha256=4qvNN-8GqbbVsrLKxJwBeX1FUtWpKbhUWyvm7anD3iE,1916
|
5
5
|
garf_core/parsers.py,sha256=Y4wwpDXRZky7LBTBklvzk-aDNxgRL5RJg52rSdH5t9Q,2928
|
6
6
|
garf_core/query_editor.py,sha256=EzwjFnbje-RcP9VwWQwzCpy8lipt4tph3Kv6q5Lly5o,15994
|
7
7
|
garf_core/report.py,sha256=xlkZ44cdT_uGENuNeGwy69h7XLtwjdUjyPw3S1m-zc8,17852
|
8
|
-
garf_core/report_fetcher.py,sha256=
|
9
|
-
garf_core-0.0.
|
10
|
-
garf_core-0.0.
|
11
|
-
garf_core-0.0.
|
12
|
-
garf_core-0.0.
|
13
|
-
garf_core-0.0.
|
8
|
+
garf_core/report_fetcher.py,sha256=j1ewWoUvnEGM5vmWihFJ7vSVVEG1t2yzapKhylc-7eQ,4157
|
9
|
+
garf_core-0.0.8.dist-info/METADATA,sha256=Ap-TAWp1wzDtXO6WPUBE1ajGnzQ_YMUIRiIhZbzLcm8,2334
|
10
|
+
garf_core-0.0.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
11
|
+
garf_core-0.0.8.dist-info/entry_points.txt,sha256=ODxSZXwWEIXQAjRwBQsBJ6GYw8oPK6DYTo0oDVkKCpo,39
|
12
|
+
garf_core-0.0.8.dist-info/top_level.txt,sha256=Gj-Zp7fM2turGut5vTJuo5xEcKfow7cTLX3y3WFfNgA,10
|
13
|
+
garf_core-0.0.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|