collate-data-diff 0.11.3__tar.gz → 0.11.6__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 (53) hide show
  1. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/PKG-INFO +17 -7
  2. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/README.md +11 -2
  3. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/__init__.py +25 -2
  4. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/_connect.py +2 -1
  5. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/presto.py +3 -0
  6. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/snowflake.py +2 -2
  7. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/trino.py +27 -0
  8. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/pyproject.toml +11 -5
  9. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/LICENSE +0 -0
  10. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/__main__.py +0 -0
  11. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/abcs/__init__.py +0 -0
  12. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/abcs/compiler.py +0 -0
  13. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/abcs/database_types.py +0 -0
  14. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/cloud/__init__.py +0 -0
  15. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/cloud/data_source.py +0 -0
  16. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/cloud/datafold_api.py +0 -0
  17. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/config.py +0 -0
  18. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/__init__.py +0 -0
  19. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/base.py +0 -0
  20. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/bigquery.py +0 -0
  21. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/clickhouse.py +0 -0
  22. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/databricks.py +0 -0
  23. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/duckdb.py +0 -0
  24. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/mssql.py +0 -0
  25. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/mysql.py +0 -0
  26. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/oracle.py +0 -0
  27. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/postgresql.py +0 -0
  28. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/redshift.py +0 -0
  29. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/databases/vertica.py +0 -0
  30. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/dbt.py +0 -0
  31. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/dbt_config_validators.py +0 -0
  32. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/dbt_parser.py +0 -0
  33. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/diff_tables.py +0 -0
  34. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/errors.py +0 -0
  35. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/format.py +0 -0
  36. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/hashdiff_tables.py +0 -0
  37. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/info_tree.py +0 -0
  38. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/joindiff_tables.py +0 -0
  39. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/lexicographic_space.py +0 -0
  40. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/parse_time.py +0 -0
  41. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/py.typed +0 -0
  42. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/queries/__init__.py +0 -0
  43. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/queries/api.py +0 -0
  44. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/queries/ast_classes.py +0 -0
  45. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/queries/base.py +0 -0
  46. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/queries/extras.py +0 -0
  47. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/query_utils.py +0 -0
  48. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/schema.py +0 -0
  49. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/table_segment.py +0 -0
  50. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/thread_utils.py +0 -0
  51. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/tracking.py +0 -0
  52. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/utils.py +0 -0
  53. {collate_data_diff-0.11.3 → collate_data_diff-0.11.6}/data_diff/version.py +0 -0
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: collate-data-diff
3
- Version: 0.11.3
3
+ Version: 0.11.6
4
4
  Summary: Command-line tool and Python library to efficiently diff rows across two different databases.
5
- Home-page: https://github.com/datafold/data-diff
6
5
  License: MIT
7
6
  Author: Collate
8
7
  Author-email: info@getcollate.io
@@ -19,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Topic :: Database :: Database Engines/Servers
23
23
  Classifier: Typing :: Typed
24
24
  Provides-Extra: all-dbs
@@ -43,7 +43,8 @@ Requires-Dist: dsnparse (<0.2.0)
43
43
  Requires-Dist: duckdb ; extra == "duckdb" or extra == "all-dbs"
44
44
  Requires-Dist: keyring
45
45
  Requires-Dist: mashumaro[msgpack] (>=2.9,<3.11.0)
46
- 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")
47
48
  Requires-Dist: oracledb ; extra == "oracle" or extra == "all-dbs"
48
49
  Requires-Dist: preql (>=0.2.19) ; extra == "preql" or extra == "all-dbs"
49
50
  Requires-Dist: presto-python-client ; extra == "presto" or extra == "all-dbs"
@@ -51,7 +52,7 @@ Requires-Dist: psycopg2 ; extra == "postgresql" or extra == "redshift" or extra
51
52
  Requires-Dist: pydantic (>=1.10.12)
52
53
  Requires-Dist: pyodbc (>=4.0.39) ; extra == "mssql" or extra == "all-dbs"
53
54
  Requires-Dist: rich
54
- 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"
55
56
  Requires-Dist: tabulate (>=0.9.0)
56
57
  Requires-Dist: toml (>=0.10.2)
57
58
  Requires-Dist: trino (>=0.314.0) ; extra == "trino" or extra == "all-dbs"
@@ -66,6 +67,17 @@ Forked from the archived repository [datafold/data-diff](https://github.com/data
66
67
 
67
68
  # data-diff: Compare datasets fast, within or across SQL databases
68
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
+
69
81
  ## Contributors
70
82
 
71
83
  <a href="https://github.com/datafold/data-diff/graphs/contributors">
@@ -76,5 +88,3 @@ Forked from the archived repository [datafold/data-diff](https://github.com/data
76
88
 
77
89
  This project is licensed under the terms of the [MIT License](https://github.com/datafold/data-diff/blob/master/LICENSE).
78
90
 
79
- ## Publishing
80
-
@@ -3,6 +3,17 @@ Forked from the archived repository [datafold/data-diff](https://github.com/data
3
3
 
4
4
  # data-diff: Compare datasets fast, within or across SQL databases
5
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
+
6
17
  ## Contributors
7
18
 
8
19
  <a href="https://github.com/datafold/data-diff/graphs/contributors">
@@ -12,5 +23,3 @@ Forked from the archived repository [datafold/data-diff](https://github.com/data
12
23
  ## License
13
24
 
14
25
  This project is licensed under the terms of the [MIT License](https://github.com/datafold/data-diff/blob/master/LICENSE).
15
-
16
- ## Publishing
@@ -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(
@@ -1,4 +1,5 @@
1
1
  import logging
2
+ import json
2
3
  from typing import Hashable, MutableMapping, Type, Optional, Union, Dict
3
4
  from itertools import zip_longest
4
5
  from contextlib import suppress
@@ -291,7 +292,7 @@ class Connect:
291
292
 
292
293
  def __make_cache_key(self, db_conf: Union[str, dict]) -> Hashable:
293
294
  if isinstance(db_conf, dict):
294
- return tuple(db_conf.items())
295
+ return json.dumps(db_conf)
295
296
  return db_conf
296
297
 
297
298
 
@@ -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) or kw.get("driver") == "trino":
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,6 +1,7 @@
1
1
  from typing import Any, ClassVar, Type
2
2
 
3
3
  import attrs
4
+ from requests import Session
4
5
 
5
6
  from data_diff.abcs.database_types import TemporalType, ColType_UUID
6
7
  from data_diff.databases import presto
@@ -47,4 +48,30 @@ class Trino(presto.Presto):
47
48
  if kw.get("schema"):
48
49
  self.default_schema = kw.get("schema")
49
50
 
51
+ if kw.get("http_session"):
52
+ session = Session()
53
+ session.proxies = kw.get("http_session", {}).get("proxies")
54
+
55
+ kw["http_session"] = session
56
+
57
+ auth = kw.get("auth")
58
+
59
+ if auth:
60
+ if auth.get("authType") == "basic":
61
+ kw["auth"] = trino.auth.BasicAuthentication(
62
+ auth.get("username"),
63
+ auth.get("password")
64
+ )
65
+ kw["http_scheme"] = "https"
66
+
67
+ elif auth.get("authType") == "jwt":
68
+ kw["auth"] = trino.auth.JWTAuthentication(
69
+ auth.get("jwt")
70
+ )
71
+ kw["http_scheme"] = "https"
72
+
73
+ elif auth.get("authType") == "oauth2":
74
+ kw["auth"] = trino.auth.OAuth2Authentication()
75
+ kw["http_scheme"] = "https"
76
+
50
77
  self._conn = trino.dbapi.connect(**kw)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "collate-data-diff"
3
- version = "0.11.3"
3
+ version = "0.11.6"
4
4
  description = "Command-line tool and Python library to efficiently diff rows across two different databases."
5
5
  authors = ["Collate <info@getcollate.io>", "Datafold <data-diff@datafold.com>"]
6
6
  license = "MIT"
@@ -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"