Skip to content

Commit 13deb9e

Browse files
CBroz1ethho
andauthored
Apply suggestions from code review
Co-authored-by: Ethan Ho <[email protected]>
1 parent 1183898 commit 13deb9e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

datajoint/table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def delete(
486486
transaction: bool = True,
487487
safemode: Union[bool, None] = None,
488488
force_parts: bool = False,
489-
force_masters: bool = True,
489+
force_masters: bool = False,
490490
) -> int:
491491
"""
492492
Deletes the contents of the table and its dependent tables, recursively.
@@ -499,7 +499,7 @@ def delete(
499499
is `dj.config['safemode']`.
500500
force_parts: Delete from parts even when not deleting from their masters.
501501
force_masters: If `True`, include part/master pairs in the cascade.
502-
Default is `True`.
502+
Default is `False`.
503503
504504
Returns:
505505
Number of deleted rows (excluding those from dependent tables).

tests/test_cascading_delete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_delete_parts(schema_simp_pop):
127127
def test_delete_parts_complex(schema_simp_pop):
128128
"""test issue #151 with complex master/part. PR #1158."""
129129
prev_len = len(G())
130-
(A() & "id_a=1").delete()
130+
(A() & "id_a=1").delete(force_masters=True)
131131
assert prev_len - len(G()) == 16, "Failed to delete parts"
132132

133133

0 commit comments

Comments
 (0)