collate-data-diff 0.11.2__tar.gz → 0.11.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/PKG-INFO +19 -6
  2. collate_data_diff-0.11.5/README.md +25 -0
  3. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/__init__.py +25 -2
  4. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/_connect.py +11 -1
  5. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/presto.py +3 -0
  6. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/snowflake.py +2 -2
  7. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/pyproject.toml +13 -7
  8. collate_data_diff-0.11.2/README.md +0 -14
  9. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/LICENSE +0 -0
  10. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/__main__.py +0 -0
  11. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/abcs/__init__.py +0 -0
  12. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/abcs/compiler.py +0 -0
  13. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/abcs/database_types.py +0 -0
  14. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/cloud/__init__.py +0 -0
  15. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/cloud/data_source.py +0 -0
  16. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/cloud/datafold_api.py +0 -0
  17. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/config.py +0 -0
  18. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/__init__.py +0 -0
  19. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/base.py +0 -0
  20. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/bigquery.py +0 -0
  21. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/clickhouse.py +0 -0
  22. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/databricks.py +0 -0
  23. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/duckdb.py +0 -0
  24. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/mssql.py +0 -0
  25. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/mysql.py +0 -0
  26. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/oracle.py +0 -0
  27. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/postgresql.py +0 -0
  28. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/redshift.py +0 -0
  29. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/trino.py +0 -0
  30. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/databases/vertica.py +0 -0
  31. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/dbt.py +0 -0
  32. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/dbt_config_validators.py +0 -0
  33. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/dbt_parser.py +0 -0
  34. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/diff_tables.py +0 -0
  35. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/errors.py +0 -0
  36. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/format.py +0 -0
  37. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/hashdiff_tables.py +0 -0
  38. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/info_tree.py +0 -0
  39. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/joindiff_tables.py +0 -0
  40. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/lexicographic_space.py +0 -0
  41. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/parse_time.py +0 -0
  42. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/py.typed +0 -0
  43. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/queries/__init__.py +0 -0
  44. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/queries/api.py +0 -0
  45. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/queries/ast_classes.py +0 -0
  46. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/queries/base.py +0 -0
  47. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/queries/extras.py +0 -0
  48. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/query_utils.py +0 -0
  49. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/schema.py +0 -0
  50. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/table_segment.py +0 -0
  51. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/thread_utils.py +0 -0
  52. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/tracking.py +0 -0
  53. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/utils.py +0 -0
  54. {collate_data_diff-0.11.2 → collate_data_diff-0.11.5}/data_diff/version.py +0 -0
@@ -1,10 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: collate-data-diff
3
- Version: 0.11.2
3
+ Version: 0.11.5
4
4
  Summary: Command-line tool and Python library to efficiently diff rows across two different databases.
5
- Home-page: https://github.com/open-metadata/collate-data-diff
6
5
  License: MIT
7
6
  Author: Collate
7
+ Author-email: info@getcollate.io
8
8
  Requires-Python: >=3.8.0,<4.0
9
9
  Classifier: Development Status :: 2 - Pre-Alpha
10
10
  Classifier: Environment :: Console
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Topic :: Database :: Database Engines/Servers
22
23
  Classifier: Typing :: Typed
23
24
  Provides-Extra: all-dbs
@@ -42,7 +43,8 @@ Requires-Dist: dsnparse (<0.2.0)
42
43
  Requires-Dist: duckdb ; extra == "duckdb" or extra == "all-dbs"
43
44
  Requires-Dist: keyring
44
45
  Requires-Dist: mashumaro[msgpack] (>=2.9,<3.11.0)
45
- Requires-Dist: mysql-connector-python (>=8.0.29) ; extra == "mysql" or extra == "all-dbs"
46
+ Requires-Dist: mysql-connector-python (>=8.0.29) ; (python_version < "3.9") and (extra == "mysql" or extra == "all-dbs")
47
+ Requires-Dist: mysql-connector-python (>=9.1) ; (python_version >= "3.9") and (extra == "mysql" or extra == "all-dbs")
46
48
  Requires-Dist: oracledb ; extra == "oracle" or extra == "all-dbs"
47
49
  Requires-Dist: preql (>=0.2.19) ; extra == "preql" or extra == "all-dbs"
48
50
  Requires-Dist: presto-python-client ; extra == "presto" or extra == "all-dbs"
@@ -50,14 +52,14 @@ Requires-Dist: psycopg2 ; extra == "postgresql" or extra == "redshift" or extra
50
52
  Requires-Dist: pydantic (>=1.10.12)
51
53
  Requires-Dist: pyodbc (>=4.0.39) ; extra == "mssql" or extra == "all-dbs"
52
54
  Requires-Dist: rich
53
- Requires-Dist: snowflake-connector-python (>=3.0.2,<4.0.0) ; extra == "snowflake" or extra == "all-dbs"
55
+ Requires-Dist: snowflake-connector-python (>=3.13.1,<4.0.0) ; extra == "snowflake" or extra == "all-dbs"
54
56
  Requires-Dist: tabulate (>=0.9.0)
55
57
  Requires-Dist: toml (>=0.10.2)
56
58
  Requires-Dist: trino (>=0.314.0) ; extra == "trino" or extra == "all-dbs"
57
59
  Requires-Dist: typing-extensions (>=4.0.1)
58
60
  Requires-Dist: urllib3 (<2)
59
61
  Requires-Dist: vertica-python ; extra == "vertica" or extra == "all-dbs"
60
- Project-URL: Repository, https://github.com/open-metadata/collate-data-diff
62
+ Project-URL: Repository, https://github.com/datafold/data-diff
61
63
  Description-Content-Type: text/markdown
62
64
 
63
65
  Forked from the archived repository [datafold/data-diff](https://github.com/datafold/data-diff)
@@ -65,6 +67,17 @@ Forked from the archived repository [datafold/data-diff](https://github.com/data
65
67
 
66
68
  # data-diff: Compare datasets fast, within or across SQL databases
67
69
 
70
+ ## Publishing
71
+
72
+ To publish a new version of the package, follow these steps:
73
+
74
+ 1. Bump the version number in the [`pyproject.toml`](https://github.com/open-metadata/collate-data-diff/blob/main/pyproject.toml#L3) file.
75
+ 2. Trigger the [publish action](https://github.com/open-metadata/collate-data-diff/actions/workflows/publish.yml).
76
+
77
+ To publish to Test PyPI, set the "test" input to "true" when triggering the action.
78
+
79
+ To publish a dev release, set the "dev" input to "true" when triggering the action.
80
+
68
81
  ## Contributors
69
82
 
70
83
  <a href="https://github.com/datafold/data-diff/graphs/contributors">
@@ -0,0 +1,25 @@
1
+ Forked from the archived repository [datafold/data-diff](https://github.com/datafold/data-diff)
2
+ ---
3
+
4
+ # data-diff: Compare datasets fast, within or across SQL databases
5
+
6
+ ## Publishing
7
+
8
+ To publish a new version of the package, follow these steps:
9
+
10
+ 1. Bump the version number in the [`pyproject.toml`](https://github.com/open-metadata/collate-data-diff/blob/main/pyproject.toml#L3) file.
11
+ 2. Trigger the [publish action](https://github.com/open-metadata/collate-data-diff/actions/workflows/publish.yml).
12
+
13
+ To publish to Test PyPI, set the "test" input to "true" when triggering the action.
14
+
15
+ To publish a dev release, set the "dev" input to "true" when triggering the action.
16
+
17
+ ## Contributors
18
+
19
+ <a href="https://github.com/datafold/data-diff/graphs/contributors">
20
+ <img src="https://contributors-img.web.app/image?repo=datafold/data-diff" />
21
+ </a>
22
+
23
+ ## License
24
+
25
+ This project is licensed under the terms of the [MIT License](https://github.com/datafold/data-diff/blob/master/LICENSE).
@@ -32,12 +32,35 @@ def connect_to_table(
32
32
  if isinstance(key_columns, str):
33
33
  key_columns = (key_columns,)
34
34
 
35
- db: Database = connect(db_info, thread_count=thread_count)
35
+ kw, kwargs = _get_table_segment_args(**kwargs)
36
+
37
+ db: Database = connect(db_info, thread_count=thread_count, **kwargs)
36
38
 
37
39
  if isinstance(table_name, str):
38
40
  table_name = db.dialect.parse_table_name(table_name)
39
41
 
40
- return TableSegment(db, table_name, key_columns, **kwargs)
42
+ return TableSegment(db, table_name, key_columns, **kw)
43
+
44
+ def _get_table_segment_args(**kwargs):
45
+ accepted_kwargs = {
46
+ "update_column",
47
+ "extra_columns",
48
+ "min_key",
49
+ "max_key",
50
+ "min_update",
51
+ "max_update",
52
+ "where",
53
+ "case_sensitive",
54
+ }
55
+ kw = {}
56
+ copy_kwargs = dict(kwargs)
57
+ for k, v in copy_kwargs.items():
58
+ if k in accepted_kwargs:
59
+ kw[k] = kwargs.pop(k)
60
+ if v is None and k not in accepted_kwargs:
61
+ kwargs.pop(k)
62
+
63
+ return kw, kwargs
41
64
 
42
65
 
43
66
  def diff_tables(
@@ -3,6 +3,7 @@ from typing import Hashable, MutableMapping, Type, Optional, Union, Dict
3
3
  from itertools import zip_longest
4
4
  from contextlib import suppress
5
5
  import weakref
6
+ from urllib.parse import unquote
6
7
 
7
8
  import attrs
8
9
  import dsnparse
@@ -26,6 +27,15 @@ from data_diff.databases.duckdb import DuckDB
26
27
  from data_diff.databases.mssql import MsSQL
27
28
 
28
29
 
30
+ class CustomParseResult(dsnparse.ParseResult):
31
+ @classmethod
32
+ def parse_credentials(cls, dsn):
33
+ username, password, dsn = super().parse_credentials(dsn)
34
+ if password:
35
+ password = unquote(password)
36
+ return username, password, dsn
37
+
38
+
29
39
  @attrs.frozen
30
40
  class MatchUriPath:
31
41
  database_cls: Type[Database]
@@ -136,7 +146,7 @@ class Connect:
136
146
  - duckdb
137
147
  """
138
148
 
139
- dsn = dsnparse.parse(db_uri)
149
+ dsn = dsnparse.parse(db_uri, parse_class=CustomParseResult)
140
150
  if len(dsn.schemes) > 1:
141
151
  raise NotImplementedError("No support for multiple schemes")
142
152
  (scheme,) = dsn.schemes
@@ -154,6 +154,9 @@ class Presto(Database):
154
154
 
155
155
  def __init__(self, **kw) -> None:
156
156
  super().__init__()
157
+ if not len(kw):
158
+ # this is a trino connection
159
+ return
157
160
  self.default_schema = "public"
158
161
  prestodb = import_presto()
159
162
 
@@ -139,11 +139,11 @@ class Snowflake(Database):
139
139
  with open(key, "rb") as f:
140
140
  key_bytes = f.read()
141
141
  if key_content:
142
- key_bytes = base64.b64decode(key_content)
142
+ key_bytes = bytes(key_content, "utf-8")
143
143
 
144
144
  # If a private key is used, read it from the specified path and pass it as "private_key" to the connector.
145
145
  if key_bytes:
146
- if "password" in kw:
146
+ if "password" in kw and (kw.get("password") != "" or kw.get("password") is not None):
147
147
  raise ConnectError("Cannot use password and key at the same time")
148
148
  if kw.get("private_key_passphrase"):
149
149
  encoded_passphrase = kw.get("private_key_passphrase").encode()
@@ -1,11 +1,11 @@
1
1
  [tool.poetry]
2
2
  name = "collate-data-diff"
3
- version = "0.11.2"
3
+ version = "0.11.5"
4
4
  description = "Command-line tool and Python library to efficiently diff rows across two different databases."
5
- authors = ["Collate"]
5
+ authors = ["Collate <info@getcollate.io>", "Datafold <data-diff@datafold.com>"]
6
6
  license = "MIT"
7
7
  readme = "README.md"
8
- repository = "https://github.com/open-metadata/collate-data-diff"
8
+ repository = "https://github.com/datafold/data-diff"
9
9
  classifiers = [
10
10
  "Intended Audience :: Developers",
11
11
  "Intended Audience :: Information Technology",
@@ -27,9 +27,12 @@ dsnparse = "<0.2.0"
27
27
  click = ">=8.1"
28
28
  rich = "*"
29
29
  toml = ">=0.10.2"
30
- mysql-connector-python = {version=">=8.0.29", optional=true}
30
+ mysql-connector-python = [
31
+ {version=">=8.0.29", python = "<3.9", optional=true},
32
+ {version=">=9.1", python = ">=3.9", optional=true}
33
+ ]
31
34
  psycopg2 = {version="*", optional=true}
32
- snowflake-connector-python = {version = ">=3.0.2,<4.0.0", optional=true}
35
+ snowflake-connector-python = {version = ">=3.13.1,<4.0.0", optional=true}
33
36
  cryptography = {version="*", optional=true}
34
37
  trino = {version=">=0.314.0", optional=true}
35
38
  presto-python-client = {version="*", optional=true}
@@ -51,9 +54,12 @@ mashumaro = {version = ">=2.9,<3.11.0", extras = ["msgpack"]}
51
54
  parameterized = "*"
52
55
  unittest-parallel = "*"
53
56
  preql = ">=0.2.19"
54
- mysql-connector-python = "*"
57
+ mysql-connector-python = [
58
+ {version=">=8.0.29", python = "<3.9"},
59
+ {version=">=9.1", python = ">=3.9"}
60
+ ]
55
61
  psycopg2 = "*"
56
- snowflake-connector-python = ">=3.0.2,<4.0.0"
62
+ snowflake-connector-python = ">=3.13.1,<4.0.0"
57
63
  cryptography = "*"
58
64
  trino = ">=0.314.0"
59
65
  presto-python-client = ">=0.8.3"
@@ -1,14 +0,0 @@
1
- Forked from the archived repository [datafold/data-diff](https://github.com/datafold/data-diff)
2
- ---
3
-
4
- # data-diff: Compare datasets fast, within or across SQL databases
5
-
6
- ## Contributors
7
-
8
- <a href="https://github.com/datafold/data-diff/graphs/contributors">
9
- <img src="https://contributors-img.web.app/image?repo=datafold/data-diff" />
10
- </a>
11
-
12
- ## License
13
-
14
- This project is licensed under the terms of the [MIT License](https://github.com/datafold/data-diff/blob/master/LICENSE).