Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/core/garf_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '0.1.4'
__version__ = '0.1.4.post1'
2 changes: 1 addition & 1 deletion libs/core/garf_core/api_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def from_csv(cls, file_location: str | os.PathLike[str]) -> FakeApiClient:
{key: _field_converter(value) for key, value in row.items()}
)
return FakeApiClient(data)
except FileNotFoundError as e:
except (AttributeError, FileNotFoundError) as e:
raise GarfApiError(f'Failed to open {file_location}') from e


Expand Down
14 changes: 4 additions & 10 deletions libs/core/garf_core/query_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,18 @@
import jinja2
import pydantic
from dateutil import relativedelta
from typing_extensions import Self
from typing_extensions import Self, TypeAlias

from garf_core import exceptions

QueryParameters = dict[str, Union[str | float | int]]
QueryParameters: TypeAlias = dict[str, Union[str, float, int]]


class GarfQueryParameters(pydantic.BaseModel):
"""Parameters for dynamically changing text of a query."""

macro: QueryParameters | None = None
template: QueryParameters | None = None

def model_post_init(self, __context__) -> None:
if self.macro is None:
self.macro = {}
if self.template is None:
self.template = {}
macro: QueryParameters = pydantic.Field(default_factory=dict)
template: QueryParameters = pydantic.Field(default_factory=dict)


class GarfQueryError(exceptions.GarfError):
Expand Down
4 changes: 2 additions & 2 deletions libs/core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ dependencies = [
"requests",
"pyyaml",
"pydantic",
"eval_type_backport",
]
authors = [
{name = "Google Inc. (gTech gPS CSE team)", email = "no-reply@google.com"},
{name = "Andrei Markin", email = "andrey.markin.ppc@gmail.com"},
]
requires-python = ">=3.8"
requires-python = ">=3.9"
description = "Abstracts fetching data from API based on provided SQL-like query."
readme = "README.md"
license = {text = "Apache 2.0"}
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
Loading