Skip to content

Commit

Permalink
fix(local-fs): handling non-iterator response from local fs interface (
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-eric authored Apr 27, 2022
1 parent e31ef6b commit e1be9ce
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import logging
from pathlib import Path
from typing import Iterator
import uuid

from iceberg.exceptions import CommitFailedException, ValidationException
Expand Down Expand Up @@ -127,7 +128,10 @@ def read_version_hint(self):
else:
with fs.open(version_hint_file, "r") as fo:
# return int(fo.readline().replace("\n", ""))
return int(next(fo.readline()))
line = fo.readline()
if isinstance(line, Iterator):
return int(next(line))
return int(line)

def write_version_hint(self, version):
version_hint_file = str(self.version_hint_file())
Expand Down

0 comments on commit e1be9ce

Please sign in to comment.