garf-core 0.1.2__py3-none-any.whl → 0.1.4__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 CHANGED
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = '0.1.2'
15
+ __version__ = '0.1.4'
garf_core/parsers.py CHANGED
@@ -83,6 +83,8 @@ class DictParser(BaseParser):
83
83
 
84
84
  def get_nested_field(self, dictionary: dict[str, Any], key: str):
85
85
  """Returns nested fields from a dictionary."""
86
+ if result := dictionary.get(key):
87
+ return result
86
88
  key = key.split('.')
87
89
  try:
88
90
  return functools.reduce(operator.getitem, key, dictionary)
@@ -102,6 +104,9 @@ class NumericConverterDictParser(DictParser):
102
104
  return type_(value)
103
105
  return value
104
106
 
107
+ if result := dictionary.get(key):
108
+ return convert_field(result)
109
+
105
110
  key = key.split('.')
106
111
  try:
107
112
  field = functools.reduce(operator.getitem, key, dictionary)
garf_core/query_editor.py CHANGED
@@ -20,7 +20,7 @@ import dataclasses
20
20
  import datetime
21
21
  import logging
22
22
  import re
23
- from typing import Generator
23
+ from typing import Generator, Union
24
24
 
25
25
  import jinja2
26
26
  import pydantic
@@ -29,7 +29,7 @@ from typing_extensions import Self
29
29
 
30
30
  from garf_core import exceptions
31
31
 
32
- QueryParameters = dict[str, str | float | int]
32
+ QueryParameters = dict[str, Union[str | float | int]]
33
33
 
34
34
 
35
35
  class GarfQueryParameters(pydantic.BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: garf-core
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Abstracts fetching data from API based on provided SQL-like query.
5
5
  Author-email: "Google Inc. (gTech gPS CSE team)" <no-reply@google.com>, Andrei Markin <andrey.markin.ppc@gmail.com>
6
6
  License: Apache 2.0
@@ -1,16 +1,16 @@
1
- garf_core/__init__.py,sha256=GIvTQD8k9INUEIQO5HBfLShtzbins5jjqQfi0z2J9h0,598
1
+ garf_core/__init__.py,sha256=FIWuMX0le-B-dJeMj8WogjFNQW8agVqAJYTpEh8knDE,598
2
2
  garf_core/api_clients.py,sha256=k4vjFsA3JOx7Hp_pXIQNwzMXqq4u4dDcz-ddkJC0JhI,4651
3
3
  garf_core/base_query.py,sha256=ZDAw2ojmismXRO0HXEvKDukpS7OAc7390LnM8kvCSCY,1201
4
4
  garf_core/exceptions.py,sha256=Gzvkl2M-rA_XQRAMd3CC62KHeFQE_b6uby0fD0pouw4,1269
5
- garf_core/parsers.py,sha256=-178UL2hbrC83GkMqAPgrmpGpJitR7T9xT3OgJ8w16Y,3189
6
- garf_core/query_editor.py,sha256=lA1aMFc_1wo6e2CyVISarnZxtH2jnKkuZfJecQqslDg,17191
5
+ garf_core/parsers.py,sha256=PmF8Ez0s1k2duSbO-0MZClslILxzbZyGMbTlhFjOtVE,3321
6
+ garf_core/query_editor.py,sha256=02lDdutFcwP0IWpTAxY_KUg6fHehtNGo8MMb4lXRG3w,17205
7
7
  garf_core/report.py,sha256=O0SPxgVQckxi_QuD3vy1h_1mi5aMjQNw0LYP-jgN2Do,20262
8
8
  garf_core/report_fetcher.py,sha256=dgErrkRv1bdPN0npX3atZbJrOpzy9OmoPC38e2FpBSQ,4883
9
9
  garf_core/fetchers/__init__.py,sha256=_cSjg1D5RhUKxaVeVbaDdb8AAoI9glKJXgN5H4qXFkw,783
10
10
  garf_core/fetchers/fake.py,sha256=fgJjxuHyd6EIUflUtj8r_HfaMS1YTDrOqDlaj6Kvbjs,2584
11
11
  garf_core/fetchers/rest.py,sha256=-5B2-Ck_t3hG99ym59AKwlzctiDxRFI2Nnc8STBxRDo,2201
12
- garf_core-0.1.2.dist-info/METADATA,sha256=dGX17SeAetNBUlagvqWDGHX4yzIura36Bl1CP0Bd0OU,2443
13
- garf_core-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- garf_core-0.1.2.dist-info/entry_points.txt,sha256=u4h-ujHO1hbxVXRQzwcC4ftju9_KBYtq5mCLKEBHMj0,69
15
- garf_core-0.1.2.dist-info/top_level.txt,sha256=Gj-Zp7fM2turGut5vTJuo5xEcKfow7cTLX3y3WFfNgA,10
16
- garf_core-0.1.2.dist-info/RECORD,,
12
+ garf_core-0.1.4.dist-info/METADATA,sha256=VbJF2l2UWHNgQbFXzZPiRrdXi1FNSRyJPHkUQhayJqY,2443
13
+ garf_core-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ garf_core-0.1.4.dist-info/entry_points.txt,sha256=u4h-ujHO1hbxVXRQzwcC4ftju9_KBYtq5mCLKEBHMj0,69
15
+ garf_core-0.1.4.dist-info/top_level.txt,sha256=Gj-Zp7fM2turGut5vTJuo5xEcKfow7cTLX3y3WFfNgA,10
16
+ garf_core-0.1.4.dist-info/RECORD,,