Skip to content

Commit 4cd09ae

Browse files
committed
Fix codestyle issues
1 parent 7efb032 commit 4cd09ae

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/sagemaker/iterators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ def __next__(self):
186186
print("Unknown event type:" + chunk)
187187
continue
188188

189+
189190
# Check buffer size before writing to prevent unbounded memory consumption
190191
chunk_size = len(chunk["PayloadPart"]["Bytes"])
191192
current_size = self.buffer.getbuffer().nbytes
@@ -195,5 +196,6 @@ def __next__(self):
195196
f"No newline found in stream."
196197
)
197198

199+
198200
self.buffer.seek(0, io.SEEK_END)
199201
self.buffer.write(chunk["PayloadPart"]["Bytes"])

src/sagemaker/local/data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def __init__(self, root_path):
138138

139139
self.root_path = os.path.abspath(root_path)
140140

141+
141142
# Validate that the path is not in restricted locations
142143
for restricted_path in self.RESTRICTED_PATHS:
143144
if self.root_path.startswith(restricted_path):
@@ -146,6 +147,7 @@ def __init__(self, root_path):
146147
f"Got: {root_path}"
147148
)
148149

150+
149151
if not os.path.exists(self.root_path):
150152
raise RuntimeError("Invalid data source: %s does not exist." % self.root_path)
151153

0 commit comments

Comments
 (0)