Skip to content

Commit

Permalink
format some files
Browse files Browse the repository at this point in the history
  • Loading branch information
Xin Huang committed Feb 13, 2024
1 parent 200a984 commit 983acf2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion python/src/space/core/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from substrait.algebra_pb2 import ReadRel, Rel

from space.core.options import FileOptions, JoinOptions, ReadOptions

from space.core.runners import LocalRunner
from space.core.storage import Storage, Version
from space.core.transform.plans import LogicalPlanBuilder
Expand Down
5 changes: 2 additions & 3 deletions python/src/space/core/ops/append.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def __init__(self,

self._patch = rt.Patch()


def write(self, data: InputData) -> None:
if not isinstance(data, pa.Table):
data = pa.Table.from_pydict(data)
Expand Down Expand Up @@ -235,8 +234,8 @@ def _finish_index_writer(self) -> None:
file_path = self._index_writer_info.file_path
stats = self._index_manifest_writer.write(
file_path, self._index_writer_info.writer.writer.metadata)
utils.update_index_storage_stats(base=self._patch.storage_statistics_update,
update=stats)
utils.update_index_storage_stats(
base=self._patch.storage_statistics_update, update=stats)

self._patch.change_log.added_rows.append(
meta.RowBitmap(file=file_path, all_rows=True, num_rows=stats.num_rows))
Expand Down
17 changes: 8 additions & 9 deletions python/src/space/core/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

# Initial snapshot ID.
_INIT_SNAPSHOT_ID = 0
# Name for the main branch, by default the read write are using this branch.
_MAIN_BRANCH = "main"
_RESERVED_REFERENCE = [_MAIN_BRANCH]

Expand Down Expand Up @@ -97,6 +98,7 @@ def current_branch(self) -> str:
"""Return the current branch."""
if not self._current_branch:
return _MAIN_BRANCH

return self._current_branch

@property
Expand Down Expand Up @@ -204,10 +206,8 @@ def reload(self) -> bool:
return False

metadata = _read_metadata(self._fs, self._location, entry_point)
self.__init__( # type: ignore[misc] # pylint: disable=unnecessary-dunder-call
self.location,
entry_point.metadata_file,
metadata,
self.__init__( # type: ignore[misc] # pylint: disable=unnecessary-dunder-call
self.location, entry_point.metadata_file, metadata,
self.current_branch)
logging.info(
f"Storage reloaded to snapshot: {self._metadata.current_snapshot_id}")
Expand Down Expand Up @@ -247,11 +247,10 @@ def set_current_branch(self, branch: str):
raise errors.UserInputError("{branch} is not a branch.")
self._current_branch = branch

def _add_reference(
self,
reference_name: str,
reference_type: meta.SnapshotReference.ReferenceType.ValueType,
snapshot_id: Optional[int] = None) -> None:
def _add_reference(self,
ref_name: str,
ref_type: meta.SnapshotReference.ReferenceType.ValueType,
snapshot_id: Optional[int] = None) -> None:
"""Add reference to a snapshot"""
if snapshot_id is None:
snapshot_id = self._metadata.current_snapshot_id
Expand Down

0 comments on commit 983acf2

Please sign in to comment.