Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions data_diff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@
from .table_segment import TableSegment
from .utils import eval_name_template

### Temporary patch
import sqeleton.utils

new_base = ''.join([chr(x) for x in range(32,127)]).replace("'", "")
n2a = sqeleton.utils.numberToAlphanum
a2n = sqeleton.utils.alphanumToNumber

def numberToAlphanum(num: int):
return n2a(num, base=new_base)

def alphanumToNumber(alphanum: str) -> int:
return a2n(alphanum, base=new_base)

sqeleton.utils.numberToAlphanum = numberToAlphanum
sqeleton.utils.alphanumToNumber = alphanumToNumber
sqeleton.utils.alphanums = new_base

###




def connect_to_table(
db_info: Union[str, dict],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "data-diff"
version = "0.3.1"
version = "0.3.2a"
description = "Command-line tool and Python library to efficiently diff rows across two different databases."
authors = ["Datafold <data-diff@datafold.com>"]
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_diff_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def test_alphanum_keys(self):
diff = list(differ.diff_tables(self.a, self.b))
self.assertEqual(diff, [("-", (str(self.new_alphanum), "This one is different"))])

self.connection.query([self.src_table.insert_row("@@@", "<-- this bad value should not break us"), commit])
self.connection.query([self.src_table.insert_row("@@@\x03", "<-- this bad value should not break us"), commit])

self.a = table_segment(self.connection, self.table_src_path, "id", "text_comment", case_sensitive=False)
self.b = table_segment(self.connection, self.table_dst_path, "id", "text_comment", case_sensitive=False)
Expand Down Expand Up @@ -485,7 +485,7 @@ def test_varying_alphanum_keys(self):
self.assertEqual(diff, [("-", (str(self.new_alphanum), "This one is different"))])

self.connection.query(
self.src_table.insert_row("@@@", "<-- this bad value should not break us"),
self.src_table.insert_row("@@@\x04", "<-- this bad value should not break us"),
commit,
)

Expand Down