diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 37c2e8f..34154cb 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [0.2.3](changes_0.2.3.md) * [0.2.2](changes_0.2.2.md) * [0.2.1](changes_0.2.1.md) * [0.2.0](changes_0.2.0.md) @@ -11,6 +12,7 @@ --- hidden: --- +changes_0.2.3 changes_0.2.2 changes_0.2.1 changes_0.2.0 diff --git a/doc/changes/changes_0.2.3.md b/doc/changes/changes_0.2.3.md new file mode 100644 index 0000000..66e24d4 --- /dev/null +++ b/doc/changes/changes_0.2.3.md @@ -0,0 +1,10 @@ +# Exasol Notebook Connector 0.2.3, released 2023-11-28 + +## Summary + +This release makes another small update to the connections module + +## Changes + +* #31: Add a function returning an udf bucket path. +* #32: Temporarily disables https connection to BucketFs. diff --git a/exasol/connections.py b/exasol/connections.py index b358334..69c3cf0 100644 --- a/exasol/connections.py +++ b/exasol/connections.py @@ -1,9 +1,10 @@ import ssl from pathlib import Path -from typing import Optional +from typing import Optional, Any import pyexasol # type: ignore import sqlalchemy # type: ignore + import exasol.bucketfs as bfs # type: ignore from exasol.secret_store import Secrets @@ -65,11 +66,19 @@ def _extract_ssl_options(conf: Secrets) -> dict: return sslopt -def get_external_host(conf: Secrets): +def get_external_host(conf: Secrets) -> str: """Constructs the host part of a DB URL using provided configuration parameters.""" return f"{conf.EXTERNAL_HOST_NAME}:{conf.DB_PORT}" +def get_udf_bucket_path(conf: Secrets) -> str: + """ + Builds the path of the BucketFS bucket specified in the configuration, + as it's seen in the udf's file system. + """ + return f"/buckets/{conf.BUCKETFS_SERVICE}/{conf.BUCKETFS_BUCKET}" + + def open_pyexasol_connection(conf: Secrets, **kwargs) -> pyexasol.ExaConnection: """ Opens a pyexasol connection using provided configuration parameters. @@ -88,7 +97,7 @@ def open_pyexasol_connection(conf: Secrets, **kwargs) -> pyexasol.ExaConnection: For other optional parameters the default settings are as per the pyexasol interface. """ - conn_params = { + conn_params: dict[str, Any] = { "dsn": get_external_host(conf), "user": conf.USER, "password": conf.PASSWORD, @@ -158,7 +167,11 @@ def open_bucketfs_connection(conf: Secrets) -> bfs.Bucket: """ # Set up the connection parameters. - buckfs_url_prefix = "https" if _optional_encryption(conf) else "http" + # For now, just use the http. Once the exasol.bucketfs is capable of using the + # https without validating the server certificate choose between the http and + # https depending on the ENCRYPTION setting like in the code below: + # buckfs_url_prefix = "https" if _optional_encryption(conf) else "http" + buckfs_url_prefix = "http" buckfs_url = f"{buckfs_url_prefix}://{conf.EXTERNAL_HOST_NAME}:{conf.BUCKETFS_PORT}" buckfs_credentials = { conf.BUCKETFS_BUCKET: { diff --git a/pyproject.toml b/pyproject.toml index 39e59f7..90f944c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "exasol-notebook-connector" -version = "0.2.2" +version = "0.2.3" description = "Components, tools, APIs, and configurations in order to connect Jupyter notebooks to Exasol and various other systems." packages = [ {include = "exasol"}, ] authors = [ "Christoph Kuhnke " ] diff --git a/version.py b/version.py index 0372bfd..f6f5bb5 100644 --- a/version.py +++ b/version.py @@ -6,5 +6,5 @@ # If you need to change the version, do so in the project.toml, e.g. by using `poetry version X.Y.Z`. MAJOR = 0 MINOR = 2 -PATCH = 2 +PATCH = 3 VERSION = f"{MAJOR}.{MINOR}.{PATCH}"