atoti-client-directquery-synapse 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.
- atoti_client_directquery_synapse-0.9.3.dist-info/METADATA +18 -0
- atoti_client_directquery_synapse-0.9.3.dist-info/RECORD +7 -0
- atoti_client_directquery_synapse-0.9.3.dist-info/WHEEL +4 -0
- atoti_directquery_synapse/__init__.py +4 -0
- atoti_directquery_synapse/connection_config.py +83 -0
- atoti_directquery_synapse/py.typed +0 -0
- atoti_directquery_synapse/table_config.py +19 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: atoti-client-directquery-synapse
|
|
3
|
+
Version: 0.9.3
|
|
4
|
+
Summary: Code to use DirectQuery on Azure Synapse Analytics
|
|
5
|
+
Project-URL: Documentation, https://docs.atoti.io/0.9.3/api/atoti_directquery_synapse.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,synapse
|
|
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_synapse/__init__.py,sha256=m45NYYwGfJEMbZkCc04gf94VK16lEVX8Ep6uTUnWg1A,247
|
|
2
|
+
atoti_directquery_synapse/connection_config.py,sha256=uVRXPKBbPXWQQXJIo_Kpw5vmcHBdljHsuSdIazcN5Is,2355
|
|
3
|
+
atoti_directquery_synapse/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
atoti_directquery_synapse/table_config.py,sha256=7CadjwF-k-7tHYTagkWNDNE4yWF0gkIy94zPxphHZsc,525
|
|
5
|
+
atoti_client_directquery_synapse-0.9.3.dist-info/METADATA,sha256=Hx8IhSlayyB2fQQMiajT4C5eF-WJdhi_uYXPYX-3RqY,770
|
|
6
|
+
atoti_client_directquery_synapse-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
atoti_client_directquery_synapse-0.9.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from typing import final
|
|
2
|
+
|
|
3
|
+
from atoti._pydantic import PYDANTIC_CONFIG as _PYDANTIC_CONFIG
|
|
4
|
+
from atoti.directquery._external_database_connection_config import (
|
|
5
|
+
AutoMultiColumnArrayConversionConfig,
|
|
6
|
+
EmulatedTimeTravelConfig,
|
|
7
|
+
ExternalDatabaseConnectionConfig,
|
|
8
|
+
PasswordConfig,
|
|
9
|
+
)
|
|
10
|
+
from pydantic.dataclasses import dataclass
|
|
11
|
+
from typing_extensions import override
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@final
|
|
15
|
+
@dataclass(config=_PYDANTIC_CONFIG, frozen=True, kw_only=True)
|
|
16
|
+
class ConnectionConfig(
|
|
17
|
+
ExternalDatabaseConnectionConfig,
|
|
18
|
+
AutoMultiColumnArrayConversionConfig,
|
|
19
|
+
PasswordConfig,
|
|
20
|
+
):
|
|
21
|
+
"""Config to connect to a Synapse database.
|
|
22
|
+
|
|
23
|
+
Example:
|
|
24
|
+
.. doctest::
|
|
25
|
+
:hide:
|
|
26
|
+
|
|
27
|
+
>>> account_identifier = "tck-directquery-ondemand"
|
|
28
|
+
>>> session = getfixture("session_with_directquery_synapse_plugin")
|
|
29
|
+
|
|
30
|
+
>>> import os
|
|
31
|
+
>>> from atoti_directquery_synapse import ConnectionConfig
|
|
32
|
+
>>> connection_config = ConnectionConfig(
|
|
33
|
+
... url="jdbc:sqlserver://"
|
|
34
|
+
... + account_identifier
|
|
35
|
+
... + ".sql.azuresynapse.net;authentication="
|
|
36
|
+
... + os.environ["SYNAPSE_AUTHENTICATION_METHOD"]
|
|
37
|
+
... + ";user="
|
|
38
|
+
... + os.environ["SYNAPSE_USERNAME"],
|
|
39
|
+
... password=os.environ["SYNAPSE_PASSWORD"],
|
|
40
|
+
... )
|
|
41
|
+
>>> external_database = session.connect_to_external_database(connection_config)
|
|
42
|
+
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
url: str
|
|
46
|
+
"""The JDBC connection string.
|
|
47
|
+
|
|
48
|
+
See https://docs.microsoft.com/en-us/azure/synapse-analytics/sql/connection-strings#sample-jdbc-connection-string for more information.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
time_travel: EmulatedTimeTravelConfig | None = None
|
|
52
|
+
"""Optional configuration for emulated time-travel.
|
|
53
|
+
|
|
54
|
+
:meta private:
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
@override
|
|
59
|
+
def _database_key(self) -> str:
|
|
60
|
+
return "SYNAPSE"
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
@override
|
|
64
|
+
def _options(self) -> dict[str, str]:
|
|
65
|
+
return {
|
|
66
|
+
**super()._options,
|
|
67
|
+
**self._auto_multi_array_conversion_options,
|
|
68
|
+
**(
|
|
69
|
+
self.time_travel._emulated_time_travel_options
|
|
70
|
+
if self.time_travel
|
|
71
|
+
else {}
|
|
72
|
+
),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
@override
|
|
77
|
+
def _password(self) -> str | None:
|
|
78
|
+
return self.password
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
@override
|
|
82
|
+
def _url(self) -> str | None:
|
|
83
|
+
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`."""
|