atoti-client-directquery-redshift 0.9.3__py3-none-any.whl

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.
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: atoti-client-directquery-redshift
3
+ Version: 0.9.3
4
+ Summary: Code to use DirectQuery on Redshift
5
+ Project-URL: Documentation, https://docs.atoti.io/0.9.3/api/atoti_directquery_redshift.html
6
+ Project-URL: Homepage, https://www.atoti.io
7
+ Project-URL: Issues, https://github.com/atoti/atoti/issues
8
+ Author-email: ActiveViam <dev@atoti.io>
9
+ Keywords: atoti,cloud,database,directquery,redshift
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: License :: Free for non-commercial use
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.10
16
+ Requires-Dist: atoti-client==0.9.3
17
+ Requires-Dist: pydantic>=2.10.1
18
+ Requires-Dist: typing-extensions>=4.12.2
@@ -0,0 +1,7 @@
1
+ atoti_directquery_redshift/__init__.py,sha256=aOv4OgEzcvV-upqEDWUX6jtipCMtSrQUqtIryWO8HSo,211
2
+ atoti_directquery_redshift/connection_config.py,sha256=ED9-0hqqlkkm0nWqZ3pOlilwhOUVqny5eNmqOS0BYSE,2653
3
+ atoti_directquery_redshift/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ atoti_directquery_redshift/table_config.py,sha256=7CadjwF-k-7tHYTagkWNDNE4yWF0gkIy94zPxphHZsc,525
5
+ atoti_client_directquery_redshift-0.9.3.dist-info/METADATA,sha256=1jn0YjOVcIL0R6bN4PU79DJo5xNfHtLxRS0GiotY0OY,758
6
+ atoti_client_directquery_redshift-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ atoti_client_directquery_redshift-0.9.3.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,4 @@
1
+ """Code to use DirectQuery on Amazon `Redshift <https://aws.amazon.com/redshift/>`__."""
2
+
3
+ from .connection_config import ConnectionConfig as ConnectionConfig
4
+ from .table_config import TableConfig as TableConfig
@@ -0,0 +1,92 @@
1
+ from typing import Annotated, final
2
+
3
+ from atoti._pydantic import PYDANTIC_CONFIG as _PYDANTIC_CONFIG
4
+ from atoti.directquery._external_database_connection_config import (
5
+ AutoMultiColumnArrayConversionConfig,
6
+ CacheConfig,
7
+ EmulatedTimeTravelConfig,
8
+ ExternalDatabaseConnectionConfig,
9
+ PasswordConfig,
10
+ )
11
+ from pydantic import Field
12
+ from pydantic.dataclasses import dataclass
13
+ from typing_extensions import override
14
+
15
+
16
+ @final
17
+ @dataclass(config=_PYDANTIC_CONFIG, frozen=True, kw_only=True)
18
+ class ConnectionConfig(
19
+ ExternalDatabaseConnectionConfig,
20
+ AutoMultiColumnArrayConversionConfig,
21
+ CacheConfig,
22
+ PasswordConfig,
23
+ ):
24
+ """Config to connect to a Redshift database.
25
+
26
+ Example:
27
+ .. doctest::
28
+ :hide:
29
+
30
+ >>> session = getfixture("session_with_directquery_redshift_plugin")
31
+
32
+ >>> import os
33
+ >>> from atoti_directquery_redshift import ConnectionConfig
34
+ >>> connection_config = ConnectionConfig(
35
+ ... url="jdbc:redshift://"
36
+ ... + os.environ["REDSHIFT_ACCOUNT_IDENTIFIER"]
37
+ ... + ".redshift.amazonaws.com:5439/dev?user="
38
+ ... + os.environ["REDSHIFT_USERNAME"]
39
+ ... + "&schema=test_resources",
40
+ ... password=os.environ["REDSHIFT_PASSWORD"],
41
+ ... )
42
+ >>> external_database = session.connect_to_external_database(connection_config)
43
+
44
+ """
45
+
46
+ url: str
47
+ """The JDBC connection string."""
48
+
49
+ connection_pool_size: Annotated[
50
+ int,
51
+ Field(gt=0),
52
+ ] = 450 # Keep in sync with Java default
53
+ """The maximum size that the pool is allowed to reach, including both idle and in-use connections.
54
+
55
+ When the pool reaches this size, and no idle connections are available, the creation of new connections will block.
56
+ """
57
+
58
+ time_travel: EmulatedTimeTravelConfig | None = None
59
+ """Optional configuration for emulated time-travel.
60
+
61
+ :meta private:
62
+ """
63
+
64
+ @property
65
+ @override
66
+ def _database_key(self) -> str:
67
+ return "REDSHIFT"
68
+
69
+ @property
70
+ @override
71
+ def _options(self) -> dict[str, str]:
72
+ return {
73
+ **super()._options,
74
+ **self._auto_multi_array_conversion_options,
75
+ **self._cache_options,
76
+ "CONNECTION_POOL_SIZE": str(self.connection_pool_size),
77
+ **(
78
+ self.time_travel._emulated_time_travel_options
79
+ if self.time_travel
80
+ else {}
81
+ ),
82
+ }
83
+
84
+ @property
85
+ @override
86
+ def _password(self) -> str | None:
87
+ return self.password
88
+
89
+ @property
90
+ @override
91
+ def _url(self) -> str | None:
92
+ return self.url
File without changes
@@ -0,0 +1,19 @@
1
+ from typing import final
2
+
3
+ from atoti._pydantic import PYDANTIC_CONFIG as _PYDANTIC_CONFIG
4
+ from atoti.directquery._external_table_config import (
5
+ ArrayConversionConfig,
6
+ ExternalTableConfig,
7
+ )
8
+ from pydantic.dataclasses import dataclass
9
+
10
+ from .connection_config import ConnectionConfig
11
+
12
+
13
+ @final
14
+ @dataclass(config=_PYDANTIC_CONFIG, frozen=True, kw_only=True)
15
+ class TableConfig(
16
+ ExternalTableConfig[ConnectionConfig],
17
+ ArrayConversionConfig,
18
+ ):
19
+ """Config passed to :meth:`~atoti.Session.add_external_table`."""