atoti-client-directquery-snowflake 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_snowflake-0.9.3.dist-info/METADATA +18 -0
- atoti_client_directquery_snowflake-0.9.3.dist-info/RECORD +7 -0
- atoti_client_directquery_snowflake-0.9.3.dist-info/WHEEL +4 -0
- atoti_directquery_snowflake/__init__.py +4 -0
- atoti_directquery_snowflake/connection_config.py +99 -0
- atoti_directquery_snowflake/py.typed +0 -0
- atoti_directquery_snowflake/table_config.py +19 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: atoti-client-directquery-snowflake
|
|
3
|
+
Version: 0.9.3
|
|
4
|
+
Summary: Code to use DirectQuery on Snowflake
|
|
5
|
+
Project-URL: Documentation, https://docs.atoti.io/0.9.3/api/atoti_directquery_snowflake.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,snowflake
|
|
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_snowflake/__init__.py,sha256=NtATD9C5ikGfLnVQ7lYy0VdybwlYB9KnbIAtXWB0pOQ,198
|
|
2
|
+
atoti_directquery_snowflake/connection_config.py,sha256=rLr-HgtxgGMXL-loDbgzQMnHJ3FhCwQ813tR3sOF-34,2935
|
|
3
|
+
atoti_directquery_snowflake/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
atoti_directquery_snowflake/table_config.py,sha256=7CadjwF-k-7tHYTagkWNDNE4yWF0gkIy94zPxphHZsc,525
|
|
5
|
+
atoti_client_directquery_snowflake-0.9.3.dist-info/METADATA,sha256=k7Yq6csjLzTykDcz3zwGwxFxb3QREZrt6suHFxtAFgg,762
|
|
6
|
+
atoti_client_directquery_snowflake-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
atoti_client_directquery_snowflake-0.9.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
CacheConfig,
|
|
7
|
+
ExternalDatabaseConnectionConfig,
|
|
8
|
+
PasswordConfig,
|
|
9
|
+
TimeTravelConfig,
|
|
10
|
+
)
|
|
11
|
+
from pydantic.dataclasses import dataclass
|
|
12
|
+
from typing_extensions import override
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@final
|
|
16
|
+
@dataclass(config=_PYDANTIC_CONFIG, frozen=True, kw_only=True)
|
|
17
|
+
class ConnectionConfig(
|
|
18
|
+
ExternalDatabaseConnectionConfig,
|
|
19
|
+
AutoMultiColumnArrayConversionConfig,
|
|
20
|
+
CacheConfig,
|
|
21
|
+
PasswordConfig,
|
|
22
|
+
TimeTravelConfig,
|
|
23
|
+
):
|
|
24
|
+
"""Config to connect to a Snowflake database.
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
.. doctest::
|
|
28
|
+
:hide:
|
|
29
|
+
|
|
30
|
+
>>> session = getfixture("session_with_directquery_snowflake_plugin")
|
|
31
|
+
|
|
32
|
+
>>> import os
|
|
33
|
+
>>> from atoti_directquery_snowflake import ConnectionConfig
|
|
34
|
+
>>> connection_config = ConnectionConfig(
|
|
35
|
+
... url="jdbc:snowflake://"
|
|
36
|
+
... + os.environ["SNOWFLAKE_ACCOUNT_IDENTIFIER"]
|
|
37
|
+
... + ".snowflakecomputing.com/?user="
|
|
38
|
+
... + os.environ["SNOWFLAKE_USERNAME"],
|
|
39
|
+
... password=os.environ["SNOWFLAKE_PASSWORD"],
|
|
40
|
+
... )
|
|
41
|
+
>>> external_database = session.connect_to_external_database(connection_config)
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
url: str
|
|
45
|
+
"""The JDBC connection string.
|
|
46
|
+
|
|
47
|
+
See https://docs.snowflake.com/en/user-guide/jdbc-configure.html#jdbc-driver-connection-string for more information.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
array_agg_wrapper_function_name: str | None = None
|
|
51
|
+
"""The name of the User Defined Function to use to wrap the aggregations on arrays to improve performance.
|
|
52
|
+
|
|
53
|
+
This function must be defined in Snowflake and accessible to the role running the queries.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
feeding_warehouse_name: str | None = None
|
|
57
|
+
"""The name of the warehouse to use for the initial feeding.
|
|
58
|
+
|
|
59
|
+
If ``None``, the main warehouse will be used.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
@override
|
|
64
|
+
def _database_key(self) -> str:
|
|
65
|
+
return "SNOWFLAKE"
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
@override
|
|
69
|
+
def _options(self) -> dict[str, str]:
|
|
70
|
+
return {
|
|
71
|
+
**super()._options,
|
|
72
|
+
**self._auto_multi_array_conversion_options,
|
|
73
|
+
**self._cache_options,
|
|
74
|
+
**self._time_travel_options,
|
|
75
|
+
**(
|
|
76
|
+
{
|
|
77
|
+
"ARRAY_AGG_WRAPPER_FUNCTION_NAME": self.array_agg_wrapper_function_name,
|
|
78
|
+
}
|
|
79
|
+
if self.array_agg_wrapper_function_name
|
|
80
|
+
else {}
|
|
81
|
+
),
|
|
82
|
+
**(
|
|
83
|
+
{
|
|
84
|
+
"FEEDING_WAREHOUSE_NAME": self.feeding_warehouse_name,
|
|
85
|
+
}
|
|
86
|
+
if self.feeding_warehouse_name
|
|
87
|
+
else {}
|
|
88
|
+
),
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
@override
|
|
93
|
+
def _password(self) -> str | None:
|
|
94
|
+
return self.password
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
@override
|
|
98
|
+
def _url(self) -> str | None:
|
|
99
|
+
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`."""
|