Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
milinsoft committed May 12, 2024
1 parent 2fa162c commit f3c0e24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
default_language_version:
python: python3
python: python3.11
node: "14.18.0"
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
Expand Down
12 changes: 5 additions & 7 deletions app/utils/repository.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from abc import ABC, abstractmethod
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any, List, Literal
from typing import TYPE_CHECKING, Any, List

from sqlalchemy import func, insert, select, update
from sqlalchemy.sql._typing import _ColumnExpressionOrStrLabelArgument
from sqlalchemy.sql.base import _NoArg

if TYPE_CHECKING:
from pydantic import BaseModel
Expand Down Expand Up @@ -35,9 +33,9 @@ def get_one(self, filters=None, order_by=None) -> type["BaseModel"]:
def get_all(
self,
filters=None,
order_by: (Literal[None, _NoArg.NO_ARG] | _ColumnExpressionOrStrLabelArgument[Any]) = None,
aggregate_func: func | None = None,
column_name: str | None = None,
order_by=None,
aggregate_func: [func, None] = None,
column_name: [str, None] = None,
) -> list[type["BaseModel"]]:
raise NotImplementedError

Expand All @@ -62,7 +60,7 @@ def create_multi(self, data: Sequence[dict]) -> list[type["BaseModel"]]:
res = self.session.execute(stmt).scalars().all()
return res

def _build_selectee(self, aggregate_function: func | None = None, column_name: str | None = None) -> Any:
def _build_selectee(self, aggregate_function: [func, None] = None, column_name: [str, None] = None) -> Any:
# TODO: docstring
selectee = self.model
if column_name:
Expand Down

0 comments on commit f3c0e24

Please sign in to comment.