Skip to content

Commit

Permalink
No gc option (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-hoffman authored Aug 6, 2021
1 parent a107c77 commit 845d0e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doltcli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def write_file(
commit_message: Optional[str] = None,
commit_date: Optional[datetime.datetime] = None,
do_continue: Optional[bool] = False,
do_gc: Optional[bool] = True,
):
if file_handle is not None and file is not None:
raise ValueError("Specify one of: file, file_handle")
Expand Down Expand Up @@ -103,6 +104,7 @@ def writer(filepath: str):
commit_message=commit_message,
commit_date=commit_date,
do_continue=do_continue,
do_gc=do_gc,
)


Expand All @@ -116,6 +118,7 @@ def write_columns(
commit_message: Optional[str] = None,
commit_date: Optional[datetime.datetime] = None,
do_continue: Optional[bool] = False,
do_gc: Optional[bool] = True,
):
"""
Expand Down Expand Up @@ -151,6 +154,7 @@ def writer(filepath: str):
commit_message=commit_message,
commit_date=commit_date,
do_continue=do_continue,
do_gc=do_gc,
)


Expand All @@ -164,6 +168,7 @@ def write_rows(
commit_message: Optional[str] = None,
commit_date: Optional[datetime.datetime] = None,
do_continue: Optional[bool] = False,
do_gc: Optional[bool] = True,
):
"""
Expand Down Expand Up @@ -199,6 +204,7 @@ def writer(filepath: str):
commit_message=commit_message,
commit_date=commit_date,
do_continue=do_continue,
do_gc=do_gc,
)


Expand All @@ -209,6 +215,7 @@ def _import_helper(
import_mode: Optional[str] = None,
primary_key: Optional[List[str]] = None,
do_continue: Optional[bool] = False,
do_gc: Optional[bool] = True,
commit: Optional[bool] = False,
commit_message: Optional[str] = None,
commit_date: Optional[datetime.datetime] = None,
Expand All @@ -227,6 +234,8 @@ def _import_helper(
args += ["--pk={}".format(",".join(primary_key))]
if do_continue is True:
args += ["--continue"]
if do_gc is False:
args += ["--no-gc"]

dolt.execute(args + [import_file])

Expand Down
1 change: 1 addition & 0 deletions tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def test_write_file_handle(init_empty_test_repo, tmp_path):
file_handle=open(tempfile),
import_mode=CREATE,
primary_key=["id"],
do_gc=False,
)
write_file(
dolt=dolt,
Expand Down

0 comments on commit 845d0e5

Please sign in to comment.