Skip to content

Commit 9606dac

Browse files
authored
chore: move OrderingMode to enums module (googleapis#870)
1 parent 8753bdd commit 9606dac

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

bigframes/_config/bigquery_options.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from __future__ import annotations
1818

19-
from enum import Enum
2019
from typing import Literal, Optional
2120
import warnings
2221

@@ -25,14 +24,9 @@
2524
import jellyfish
2625

2726
import bigframes.constants
27+
import bigframes.enums
2828
import bigframes.exceptions
2929

30-
31-
class OrderingMode(Enum):
32-
STRICT = "strict"
33-
PARTIAL = "partial"
34-
35-
3630
SESSION_STARTED_MESSAGE = (
3731
"Cannot change '{attribute}' once a session has started. "
3832
"Call bigframes.pandas.close_session() first, if you are using the bigframes.pandas API."
@@ -64,11 +58,11 @@ def _validate_location(value: Optional[str]):
6458
)
6559

6660

67-
def _validate_ordering_mode(value: str) -> OrderingMode:
68-
if value.casefold() == OrderingMode.STRICT.value.casefold():
69-
return OrderingMode.STRICT
70-
if value.casefold() == OrderingMode.PARTIAL.value.casefold():
71-
return OrderingMode.PARTIAL
61+
def _validate_ordering_mode(value: str) -> bigframes.enums.OrderingMode:
62+
if value.casefold() == bigframes.enums.OrderingMode.STRICT.value.casefold():
63+
return bigframes.enums.OrderingMode.STRICT
64+
if value.casefold() == bigframes.enums.OrderingMode.PARTIAL.value.casefold():
65+
return bigframes.enums.OrderingMode.PARTIAL
7266
raise ValueError("Ordering mode must be one of 'strict' or 'partial'.")
7367

7468

bigframes/enums.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
import enum
2121

2222

23+
class OrderingMode(enum.Enum):
24+
"""[Preview] Values used to determine the ordering mode.
25+
26+
Default is 'strict'.
27+
"""
28+
29+
STRICT = "strict"
30+
PARTIAL = "partial"
31+
32+
2333
class DefaultIndexKind(enum.Enum):
2434
"""Sentinel values used to override default indexing behavior."""
2535

0 commit comments

Comments
 (0)