Skip to content

Commit dabba7b

Browse files
committed
Remove more unnecessary methods
1 parent 73f70b2 commit dabba7b

2 files changed

Lines changed: 1 addition & 36 deletions

File tree

singer/bookmarks.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
LOGGER = get_logger()
88

99

10-
def write_state(state):
11-
json.dump(state.to_dict(), sys.stdout, indent=2)
12-
13-
1410
class State:
1511
def __init__(
1612
self, bookmarks: Optional[Dict] = None, currently_syncing: Optional[str] = None # pylint: disable=bad-continuation
@@ -28,11 +24,6 @@ def __eq__(self, other: Any) -> bool:
2824
def bookmarks(self) -> Dict:
2925
return self._bookmarks
3026

31-
@classmethod
32-
def load(cls, filename: str) -> "State":
33-
with open(filename) as fp: # pylint: disable=invalid-name
34-
return State.from_dict(json.load(fp))
35-
3627
@classmethod
3728
def from_dict(cls, data: Dict) -> "State":
3829
return State(
@@ -46,9 +37,6 @@ def to_dict(self) -> Dict:
4637
state["currently_syncing"] = self.get_currently_syncing()
4738
return state
4839

49-
def dump(self) -> None:
50-
json.dump(self.to_dict(), sys.stdout, indent=2)
51-
5240
def _ensure_bookmark_path(self, path: Sequence) -> None:
5341
submap = self.bookmarks
5442
for path_component in path:

tests/test_bookmarks.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,6 @@
11
from copy import copy
22
import unittest
3-
from singer.bookmarks import State, write_state
4-
5-
6-
class TestWriteState(unittest.TestCase):
7-
def test_write_empty_state(self):
8-
state = State()
9-
write_state(state)
10-
11-
def test_write_state_with_bookmarks(self):
12-
stream_id_1 = "customers"
13-
bookmark_key_1 = "datetime"
14-
bookmark_val_1 = 123456789
15-
offset_key = "key"
16-
offset_val = "fizzy water"
17-
18-
bookmarks = {
19-
stream_id_1: {
20-
bookmark_key_1: bookmark_val_1,
21-
"offset": {offset_key: offset_val},
22-
}
23-
}
24-
25-
state = State(bookmarks=bookmarks, currently_syncing="customers")
26-
write_state(state)
3+
from singer.bookmarks import State
274

285

296
class TestGetBookmark(unittest.TestCase):

0 commit comments

Comments
 (0)