atoti-client-sql-bridge 6.2.2__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.3
|
|
2
|
+
Name: atoti-client-sql-bridge
|
|
3
|
+
Version: 6.2.2
|
|
4
|
+
Summary: Client part of the plugin to connect Tableau and Power BI to Atoti sessions
|
|
5
|
+
Keywords: atoti,sql-bridge
|
|
6
|
+
Author: ActiveViam
|
|
7
|
+
Author-email: ActiveViam <atoti-dev@activeviam.com>
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: License :: Free for non-commercial use
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Dist: atoti-client==6.2.2
|
|
14
|
+
Requires-Dist: pydantic>=2.12.3
|
|
15
|
+
Requires-Python: >=3.12
|
|
16
|
+
Project-URL: Documentation, https://docs.activeviam.com/engine/python-sdk/6.2/api/atoti_sql_bridge
|
|
17
|
+
Project-URL: Homepage, https://atoti.activeviam.com
|
|
18
|
+
Project-URL: Issues, https://github.com/activeviam/atoti-notebooks/issues
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
atoti_sql_bridge/__init__.py,sha256=AlP3dPSMu8Z0brO3aiqI8UlB62c9YCVxGjK4ww5LMos,1870
|
|
2
|
+
atoti_sql_bridge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
atoti_sql_bridge/sql_bridge_config.py,sha256=6wLzwYuUi0_PS9C95yVlyi9VJBlnSMgbsizvYsH_g7k,1041
|
|
4
|
+
atoti_client_sql_bridge-6.2.2.dist-info/WHEEL,sha256=f5fWSvWsg5Knq5GWa6t1nJIug0Tqo69GqAWD_9LbBKw,81
|
|
5
|
+
atoti_client_sql_bridge-6.2.2.dist-info/METADATA,sha256=wJC-fdUT3i_u8xWeOvcOzed-PLotwk5mDKNGZ975HF0,783
|
|
6
|
+
atoti_client_sql_bridge-6.2.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Client part of the `plugin <../getting_started/plugins>`__ to connect Tableau and Power BI to Atoti sessions.
|
|
2
|
+
|
|
3
|
+
.. note::
|
|
4
|
+
Not available in the community edition: `upgrade <../getting_started/upgrade_from_community_edition>`__ to use it.
|
|
5
|
+
|
|
6
|
+
This feature requires a license that enables the ``bi-adapter`` component.
|
|
7
|
+
|
|
8
|
+
Tableau and Power BI can query an Atoti session: it exposes each of its cubes as a SQL table, over the PostgreSQL wire protocol.
|
|
9
|
+
Only the SQL generated by these two tools is supported.
|
|
10
|
+
|
|
11
|
+
BI tools connect with a username and password, which are checked like any other username and password login of the session, such as the ones set in :attr:`~atoti.security.basic_authentication_security.BasicAuthenticationSecurity.credentials`.
|
|
12
|
+
|
|
13
|
+
.. doctest::
|
|
14
|
+
:hide:
|
|
15
|
+
:xdist_group: sql-bridge
|
|
16
|
+
|
|
17
|
+
>>> from test_utils import get_session_with_plugin_fixture_name
|
|
18
|
+
>>> session = getfixture(get_session_with_plugin_fixture_name("sql-bridge"))
|
|
19
|
+
|
|
20
|
+
>>> table = session.read_pandas(
|
|
21
|
+
... pd.DataFrame({"ID": ["foo"]}), keys={"ID"}, table_name="Example"
|
|
22
|
+
... )
|
|
23
|
+
>>> cube = session.create_cube(table)
|
|
24
|
+
|
|
25
|
+
>>> path, _ = session.client.get_path_and_version_id("activeviam/bi-adapter")
|
|
26
|
+
|
|
27
|
+
The ``host`` is the one the BI tool will use to reach the SQL endpoint:
|
|
28
|
+
|
|
29
|
+
>>> body = {"host": "localhost"}
|
|
30
|
+
|
|
31
|
+
.. doctest::
|
|
32
|
+
:hide:
|
|
33
|
+
|
|
34
|
+
>>> from test_utils import poll
|
|
35
|
+
>>> @poll()
|
|
36
|
+
... def wait_until_served():
|
|
37
|
+
... session.client.http_client.post(
|
|
38
|
+
... f"{path}/tableau/tds/{cube.name}", json=body
|
|
39
|
+
... ).raise_for_status()
|
|
40
|
+
>>> wait_until_served()
|
|
41
|
+
|
|
42
|
+
>>> session.client.http_client.post(
|
|
43
|
+
... f"{path}/tableau/tds/{cube.name}", json=body
|
|
44
|
+
... ).status_code
|
|
45
|
+
200
|
|
46
|
+
>>> session.client.http_client.post(
|
|
47
|
+
... f"{path}/powerbi/pbit/{cube.name}", json=body
|
|
48
|
+
... ).status_code
|
|
49
|
+
200
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
from .sql_bridge_config import SqlBridgeConfig as SqlBridgeConfig
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from typing import Annotated, final
|
|
2
|
+
|
|
3
|
+
from atoti._pydantic import PYDANTIC_CONFIG as _PYDANTIC_CONFIG
|
|
4
|
+
from atoti.config._spring_property import SpringProperty
|
|
5
|
+
from pydantic.dataclasses import dataclass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@final
|
|
9
|
+
@dataclass(config=_PYDANTIC_CONFIG, frozen=True, kw_only=True)
|
|
10
|
+
class SqlBridgeConfig:
|
|
11
|
+
"""Configuration of the SQL endpoint that BI tools connect to.
|
|
12
|
+
|
|
13
|
+
Other options, such as SSL and the naming of levels, are listed in the `Atoti Server documentation <https://docs.activeviam.com/engine/java-sdk/6.2/user_guide/querying/front_ends/sql_endpoint>`__.
|
|
14
|
+
|
|
15
|
+
>>> from atoti_sql_bridge import SqlBridgeConfig
|
|
16
|
+
>>> sql_bridge_config = SqlBridgeConfig(port=1337)
|
|
17
|
+
>>> session_config = tt.SessionConfig(sql_bridge=sql_bridge_config)
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
port: Annotated[int, SpringProperty("atoti.server.sql-bridge.port")] = 5432
|
|
21
|
+
"""The port the SQL endpoint listens on.
|
|
22
|
+
|
|
23
|
+
Use ``0`` to let the operating system pick a free port.
|
|
24
|
+
The connection files generated for the BI tools will contain whichever port was picked.
|
|
25
|
+
"""
|