Skip to content

Commit

Permalink
rename Batch to BaseBatch
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Jun 14, 2024
1 parent 2e23177 commit e9f654d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions piccolo/engine/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def validate_savepoint_name(savepoint_name: str) -> None:
)


class Batch(metaclass=ABCMeta):
class BaseBatch(metaclass=ABCMeta):
@abstractmethod
async def __aenter__(self, *args, **kwargs): ...

Expand Down Expand Up @@ -116,7 +116,7 @@ async def batch(
query: Query,
batch_size: int = 100,
node: t.Optional[str] = None,
) -> Batch:
) -> BaseBatch:
pass

@abstractmethod
Expand Down
4 changes: 2 additions & 2 deletions piccolo/engine/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

from piccolo.engine.base import (
BaseAtomic,
BaseBatch,
BaseTransaction,
Batch,
Engine,
validate_savepoint_name,
)
Expand All @@ -30,7 +30,7 @@


@dataclass
class AsyncBatch(Batch):
class AsyncBatch(BaseBatch):
connection: Connection
query: Query
batch_size: int
Expand Down
4 changes: 2 additions & 2 deletions piccolo/engine/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

from piccolo.engine.base import (
BaseAtomic,
BaseBatch,
BaseTransaction,
Batch,
Engine,
validate_savepoint_name,
)
Expand Down Expand Up @@ -317,7 +317,7 @@ def convert_M2M_out(value: str) -> t.List:


@dataclass
class AsyncBatch(Batch):
class AsyncBatch(BaseBatch):
connection: Connection
query: Query
batch_size: int
Expand Down
4 changes: 2 additions & 2 deletions piccolo/query/methods/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from piccolo.columns.column_types import ForeignKey
from piccolo.columns.combination import And, Where
from piccolo.custom_types import Combinable, TableInstance
from piccolo.engine.base import Batch
from piccolo.engine.base import BaseBatch
from piccolo.query.base import Query
from piccolo.query.methods.select import Select
from piccolo.query.mixins import (
Expand Down Expand Up @@ -298,7 +298,7 @@ async def batch(
batch_size: t.Optional[int] = None,
node: t.Optional[str] = None,
**kwargs,
) -> Batch:
) -> BaseBatch:
if batch_size:
kwargs.update(batch_size=batch_size)
if node:
Expand Down
4 changes: 2 additions & 2 deletions piccolo/query/methods/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from piccolo.columns.m2m import M2MSelect
from piccolo.columns.readable import Readable
from piccolo.custom_types import TableInstance
from piccolo.engine.base import Batch
from piccolo.engine.base import BaseBatch
from piccolo.query.base import Query
from piccolo.query.mixins import (
AsOfDelegate,
Expand Down Expand Up @@ -442,7 +442,7 @@ async def batch(
batch_size: t.Optional[int] = None,
node: t.Optional[str] = None,
**kwargs,
) -> Batch:
) -> BaseBatch:
if batch_size:
kwargs.update(batch_size=batch_size)
if node:
Expand Down

0 comments on commit e9f654d

Please sign in to comment.