Skip to content

Commit 382d72c

Browse files
[core] fix: parse dot separated keys first
If field in BaseQueryElements contains dots process them as is, if no key found, performn splitting and nest searching
1 parent 6e49106 commit 382d72c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

libs/core/garf_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = '0.1.2'
15+
__version__ = '0.1.3'

libs/core/garf_core/parsers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def parse_row(
8383

8484
def get_nested_field(self, dictionary: dict[str, Any], key: str):
8585
"""Returns nested fields from a dictionary."""
86+
if result := dictionary.get(key):
87+
return result
8688
key = key.split('.')
8789
try:
8890
return functools.reduce(operator.getitem, key, dictionary)
@@ -102,6 +104,9 @@ def convert_field(value):
102104
return type_(value)
103105
return value
104106

107+
if result := dictionary.get(key):
108+
return convert_field(result)
109+
105110
key = key.split('.')
106111
try:
107112
field = functools.reduce(operator.getitem, key, dictionary)

0 commit comments

Comments
 (0)