Skip to content

Commit a378215

Browse files
committed
fixed: SettingWithCopyWarning in failing checks
1 parent 35cd220 commit a378215

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
## [0.11.1] - 2022-02-16
6+
7+
### Fixed
8+
- SettingWithCopyWarning in failing checks
59
## [0.11.0] - 2022-02-15
610

711
### Added

data_check/output/output.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def prepare_pprint_df(
101101
if self.print_diffed and isinstance(result, DataCheckResult):
102102
df = get_diffed_df(df, result)
103103
if "_merge" in df.columns:
104+
df = df.copy()
104105
df["_diff"] = ""
105106
df.loc[df._merge == "left_only", ["_diff"]] = "db"
106107
df.loc[df._merge == "right_only", ["_diff"]] = "expected"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "data_check"
3-
version = "0.11.0"
3+
version = "0.11.1"
44
description = "simple data validation"
55
authors = ["Andreas Rjasanow <andrjas@gmail.com>"]
66
license = "MIT"

test/int_test/cli/test_cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import shutil
55
from os import linesep, sep
66
from typing import List, Optional
7+
import warnings
78

89
from data_check.cli.main import main
910

@@ -545,3 +546,11 @@ def test_log_is_written_in_project_path(tmp_path: Path):
545546

546547
log_file = tmp_path / "dc.log"
547548
assert log_file.exists()
549+
550+
551+
def test_failing_prints_no_setting_with_copy_warning():
552+
with warnings.catch_warnings(record=True) as record:
553+
run(["checks/failing/diff.sql"])
554+
for i in record:
555+
print(i)
556+
assert not record

0 commit comments

Comments
 (0)