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
4 changes: 2 additions & 2 deletions sqlspec/builder/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import re
from abc import ABC, abstractmethod
from abc import abstractmethod
from collections.abc import Callable, Iterable, Mapping
from typing import Any, NoReturn, cast

Expand Down Expand Up @@ -115,7 +115,7 @@ def __hash__(self) -> int:
return hash((self.sql, frozenset(self.parameters.items()), self.dialect))


class QueryBuilder(ABC):
class QueryBuilder:
"""Abstract base class for SQL query builders.

Provides common functionality for dialect handling, parameter management,
Expand Down
8 changes: 4 additions & 4 deletions sqlspec/core/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- Cacheable filter configurations
"""

from abc import ABC, abstractmethod
from abc import abstractmethod
from collections import abc
from datetime import datetime
from typing import TYPE_CHECKING, Any, ClassVar, Generic, Literal, TypeAlias
Expand Down Expand Up @@ -68,7 +68,7 @@


@mypyc_attr(allow_interpreted_subclasses=True)
class StatementFilter(ABC):
class StatementFilter:
"""Abstract base class for filters that can be appended to a statement."""

__slots__ = ()
Expand Down Expand Up @@ -334,7 +334,7 @@ def on_or_after(self) -> datetime | None:
return self._lower_value


class InAnyFilter(StatementFilter, ABC, Generic[T]):
class InAnyFilter(StatementFilter, Generic[T]):
"""Base class for collection-based filters that support ANY operations."""

__slots__ = ("_field_name", "_values")
Expand Down Expand Up @@ -473,7 +473,7 @@ class NotAnyCollectionFilter(InAnyFilter[T]):
_parameter_suffix: ClassVar[str] = "not_any"


class PaginationFilter(StatementFilter, ABC):
class PaginationFilter(StatementFilter):
"""Base class for pagination-related filters."""

__slots__ = ()
Expand Down
7 changes: 4 additions & 3 deletions sqlspec/core/result/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
ArrowResult: Apache Arrow format results for data interchange.
"""

from abc import ABC, abstractmethod
from collections.abc import Iterable, Iterator, Sequence
from abc import abstractmethod
from typing import TYPE_CHECKING, Any, Final, Literal, cast, overload

from mypy_extensions import mypyc_attr
Expand Down Expand Up @@ -42,6 +41,8 @@
from sqlspec.utils.schema import to_schema

if TYPE_CHECKING:
from collections.abc import Iterator, Sequence

from sqlspec.core.compiler import OperationType
from sqlspec.typing import ArrowReturnFormat, ArrowTable, PandasDataFrame, PolarsDataFrame, SchemaT

Expand All @@ -57,7 +58,7 @@


@mypyc_attr(allow_interpreted_subclasses=False)
class StatementResult(ABC, Iterable[Any]):
class StatementResult:
"""Abstract base class for SQL statement execution results.

Provides a common interface for handling different types of SQL operation
Expand Down
4 changes: 2 additions & 2 deletions sqlspec/core/splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import logging
import re
import threading
from abc import ABC, abstractmethod
from abc import abstractmethod
from collections.abc import Callable
from enum import Enum
from re import Pattern
Expand Down Expand Up @@ -141,7 +141,7 @@ def __repr__(self) -> str:


@mypyc_attr(allow_interpreted_subclasses=False)
class DialectConfig(ABC):
class DialectConfig:
"""Abstract base class for SQL dialect configurations."""

__slots__ = DIALECT_CONFIG_SLOTS
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/migrations/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Base classes for SQLSpec migrations."""

import os
from abc import ABC, abstractmethod
from abc import abstractmethod
from pathlib import Path
from typing import TYPE_CHECKING, Any, Generic, TypeVar, cast

Expand Down Expand Up @@ -71,7 +71,7 @@ class AppliedMigrationRecord(TypedDict):


@mypyc_attr(allow_interpreted_subclasses=True)
class BaseMigrationTracker(ABC, Generic[DriverT]):
class BaseMigrationTracker(Generic[DriverT]):
"""Base class for migration version tracking."""

__slots__ = ("_output_policy", "version_table", "version_table_name", "version_table_schema")
Expand Down Expand Up @@ -414,7 +414,7 @@ def _is_autocommit_error(self, exc: Exception) -> bool:


@mypyc_attr(allow_interpreted_subclasses=True)
class BaseMigrationCommands(ABC, Generic[ConfigT, DriverT]):
class BaseMigrationCommands(Generic[ConfigT, DriverT]):
"""Base class for migration commands."""

extension_configs: "dict[str, dict[str, Any]]"
Expand Down
2 changes: 1 addition & 1 deletion sqlspec/migrations/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MigrationLoadError(Exception):
"""Exception raised when migration loading fails."""


class BaseMigrationLoader(abc.ABC):
class BaseMigrationLoader:
"""Abstract base class for migration loaders."""

__slots__ = ()
Expand Down
6 changes: 3 additions & 3 deletions sqlspec/migrations/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
import re
import time
from abc import ABC, abstractmethod
from abc import abstractmethod
from pathlib import Path
from typing import TYPE_CHECKING, Any, Literal, cast, overload

Expand Down Expand Up @@ -57,7 +57,7 @@ def __init__(self, path: Path, extension_name: "str | None") -> None:
self.extension_name = extension_name


class BaseMigrationRunner(ABC):
class BaseMigrationRunner:
"""Base migration runner with common functionality shared between sync and async implementations."""

def __init__(
Expand Down Expand Up @@ -485,7 +485,7 @@ def should_use_transaction(
def _resolve_default_schema(self) -> str | None:
"""Return the configured default schema for migration execution."""
config = self.context.config if self.context else None
migration_config = cast("dict[str, Any]", getattr(config, "migration_config", None))
migration_config = cast("dict[str, Any] | None", getattr(config, "migration_config", None))
return _resolve_default_schema(migration_config)

def _resolve_use_transaction(self, migration: "LoadedMigrationMetadata", use_transaction: "bool | None") -> bool:
Expand Down
4 changes: 2 additions & 2 deletions sqlspec/storage/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import asyncio
import builtins
import contextlib
from abc import ABC, abstractmethod
from abc import abstractmethod
from collections.abc import AsyncIterator, Iterator
from typing import TYPE_CHECKING, Any, cast

Expand Down Expand Up @@ -137,7 +137,7 @@ def __anext__(self) -> Any:


@mypyc_attr(allow_interpreted_subclasses=True)
class ObjectStoreBase(ABC):
class ObjectStoreBase:
"""Base class for storage backends.

All synchronous methods follow the *_sync naming convention for consistency
Expand Down
4 changes: 2 additions & 2 deletions sqlspec/utils/serializers/_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json
import threading
import uuid as uuid_mod
from abc import ABC, abstractmethod
from abc import abstractmethod
from collections.abc import Callable, Iterator, Mapping
from decimal import Decimal
from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network
Expand Down Expand Up @@ -326,7 +326,7 @@ def decode(self, data: "str | bytes", *, decode_bytes: bool = True) -> Any:
...


class BaseJSONSerializer(ABC):
class BaseJSONSerializer:
"""Base class shared by JSON serializer implementations."""

__slots__ = ()
Expand Down
Loading