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 pyiceberg/catalog/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import time
from collections import deque
from collections.abc import Mapping
from enum import Enum
from enum import Enum, StrEnum
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -113,7 +113,7 @@
logger = logging.getLogger(__name__)


class HttpMethod(str, Enum):
class HttpMethod(StrEnum):
GET = "GET"
HEAD = "HEAD"
POST = "POST"
Expand Down
4 changes: 2 additions & 2 deletions pyiceberg/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from abc import ABC, abstractmethod
from collections.abc import Callable, Iterator
from copy import copy
from enum import Enum
from enum import Enum, StrEnum
from types import TracebackType
from typing import (
Any,
Expand Down Expand Up @@ -111,7 +111,7 @@ def __repr__(self) -> str:
return f"ManifestEntryStatus.{self.name}"


class FileFormat(str, Enum):
class FileFormat(StrEnum):
AVRO = "AVRO"
PARQUET = "PARQUET"
ORC = "ORC"
Expand Down
8 changes: 2 additions & 6 deletions pyiceberg/table/refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from enum import Enum
from enum import StrEnum
from typing import Annotated

from pydantic import Field, model_validator
Expand All @@ -25,18 +25,14 @@
MAIN_BRANCH = "main"


class SnapshotRefType(str, Enum):
class SnapshotRefType(StrEnum):
BRANCH = "branch"
TAG = "tag"

def __repr__(self) -> str:
"""Return the string representation of the SnapshotRefType class."""
return f"SnapshotRefType.{self.name}"

def __str__(self) -> str:
"""Return the string representation of the SnapshotRefType class."""
return self.value


class SnapshotRef(IcebergBaseModel):
snapshot_id: int = Field(alias="snapshot-id")
Expand Down
4 changes: 2 additions & 2 deletions pyiceberg/table/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import warnings
from collections import defaultdict
from collections.abc import Iterable, Mapping
from enum import Enum
from enum import Enum, StrEnum
from typing import TYPE_CHECKING, Any

from pydantic import Field, PrivateAttr, model_serializer
Expand Down Expand Up @@ -87,7 +87,7 @@ def __repr__(self) -> str:
return f"Operation.{self.name}"


class IsolationLevel(str, Enum):
class IsolationLevel(StrEnum):
"""Transaction isolation level for concurrent write validation."""

SERIALIZABLE = "serializable"
Expand Down
Loading