Skip to content

Commit 80982ca

Browse files
authored
fix issue with odd column names (#7)
1 parent 8276b05 commit 80982ca

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/mostlyai/qa/filesystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from sklearn.decomposition import PCA
2626

2727

28-
_OLD_COL_PREFIX = r"(\w+)\."
28+
_OLD_COL_PREFIX = r"^(tgt|ctx|nxt)\."
2929
_NEW_COL_PREFIX = r"\1⁝"
3030

3131

tests/end_to_end/test_report.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,25 @@ def test_report_sequential_few_records(tmp_path):
224224
ctx_primary_key="id",
225225
)
226226
assert metrics is not None
227+
228+
229+
def test_odd_column_names(tmp_path):
230+
values = ["a", "b"] * 50
231+
df = pd.DataFrame(
232+
{
233+
"some.test": values,
234+
"foo%bar|this-long{c[u]rly} *": values,
235+
"3": values,
236+
}
237+
)
238+
path, metrics = report(
239+
syn_tgt_data=df,
240+
trn_tgt_data=df,
241+
statistics_path=tmp_path / "stats",
242+
)
243+
assert metrics is not None
244+
path = report_from_statistics(
245+
syn_tgt_data=df,
246+
statistics_path=tmp_path / "stats",
247+
)
248+
assert path is not None

0 commit comments

Comments
 (0)