Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c3611aba7 | ||
|
|
dadc14563a | ||
|
|
c1eda7305b |
@@ -1,7 +1,7 @@
|
|||||||
# MARK: Project info
|
# MARK: Project info
|
||||||
[project]
|
[project]
|
||||||
name = "corelibs"
|
name = "corelibs"
|
||||||
version = "0.25.0"
|
version = "0.25.1"
|
||||||
description = "Collection of utils for Python scripts"
|
description = "Collection of utils for Python scripts"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ def jmespath_search(search_data: dict[Any, Any] | list[Any], search_params: str)
|
|||||||
raise ValueError(f"Compile failed: {search_params}: {excp}") from excp
|
raise ValueError(f"Compile failed: {search_params}: {excp}") from excp
|
||||||
except jmespath.exceptions.ParseError as excp:
|
except jmespath.exceptions.ParseError as excp:
|
||||||
raise ValueError(f"Parse failed: {search_params}: {excp}") from excp
|
raise ValueError(f"Parse failed: {search_params}: {excp}") from excp
|
||||||
|
except jmespath.exceptions.JMESPathTypeError as excp:
|
||||||
|
raise ValueError(f"Search failed with JMESPathTypeError: {search_params}: {excp}") from excp
|
||||||
except TypeError as excp:
|
except TypeError as excp:
|
||||||
raise ValueError(f"Type error for search_params: {excp}") from excp
|
raise ValueError(f"Type error for search_params: {excp}") from excp
|
||||||
return search_result
|
return search_result
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ def main() -> None:
|
|||||||
'a',
|
'a',
|
||||||
'bar.a',
|
'bar.a',
|
||||||
'foo.a',
|
'foo.a',
|
||||||
'baz[].aa'
|
'baz[].aa',
|
||||||
|
"[?\"c\" && contains(\"c\", 'b')]",
|
||||||
|
"[?contains(\"c\", 'b')]",
|
||||||
]
|
]
|
||||||
for __jmespath in __get:
|
for __jmespath in __get:
|
||||||
result = jmespath_search(__set, __jmespath)
|
result = jmespath_search(__set, __jmespath)
|
||||||
|
|||||||
Reference in New Issue
Block a user