Skip to content

Commit 5fa4a07

Browse files
authored
Merge branch 'main' into main
2 parents 1197858 + b3d571e commit 5fa4a07

5 files changed

Lines changed: 32 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
11+
## [0.10.39] - 2025-11-20
12+
13+
### Added
14+
-
15+
- Oracle DB: Client Directory for Connection Mode 'Thick' can now be specified in the `DATACONTRACT_ORACLE_CLIENT_DIR` environment variable (#949)
16+
1017
### Fixed
1118

1219
- Import composite primary keys from open data contract spec

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,15 @@ These environment variable specify the credentials used by the datacontract tool
640640
If you've started the database from a container, e.g. [oracle-free](https://hub.docker.com/r/gvenzl/oracle-free)
641641
this should match either `system` and what you specified as `ORACLE_PASSWORD` on the container or
642642
alternatively what you've specified under `APP_USER` and `APP_USER_PASSWORD`.
643-
644-
| Environment Variable | Example | Description |
645-
|--------------------------------------------------|------------|----------------------------------------------|
646-
| `DATACONTRACT_ORACLE_USERNAME` | `system` | Username |
647-
| `DATACONTRACT_ORACLE_PASSWORD` | `0x162e53` | Password |
643+
If you require thick mode to connect to the database, you need to have an Oracle Instant Client
644+
installed on the system and specify the path to the installation within the environment variable
645+
`DATACONTRACT_ORACLE_CLIENT_DIR`.
646+
647+
| Environment Variable | Example | Description |
648+
|--------------------------------------------------|--------------------|--------------------------------------------|
649+
| `DATACONTRACT_ORACLE_USERNAME` | `system` | Username |
650+
| `DATACONTRACT_ORACLE_PASSWORD` | `0x162e53` | Password |
651+
| `DATACONTRACT_ORACLE_CLIENT_DIR` | `C:\oracle\client` | Path to Oracle Instant Client installation |
648652

649653

650654

datacontract/engines/soda/check_soda_execute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import uuid
44

55
from datacontract.engines.soda.connections.athena import to_athena_soda_configuration
6-
from datacontract.engines.soda.connections.oracle import to_oracle_soda_configuration
6+
from datacontract.engines.soda.connections.oracle import initialize_client_and_create_soda_configuration
77

88
if typing.TYPE_CHECKING:
99
from pyspark.sql import SparkSession
@@ -106,7 +106,7 @@ def check_soda_execute(
106106
scan.add_configuration_yaml_str(soda_configuration_str)
107107
scan.set_data_source_name(server.type)
108108
elif server.type == "oracle":
109-
soda_configuration_str = to_oracle_soda_configuration(server)
109+
soda_configuration_str = initialize_client_and_create_soda_configuration(server)
110110
scan.add_configuration_yaml_str(soda_configuration_str)
111111
scan.set_data_source_name(server.type)
112112
elif server.type == "trino":

datacontract/engines/soda/connections/oracle.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
from datacontract.model.data_contract_specification import Server
66

77

8+
def initialize_client_and_create_soda_configuration(server: Server) -> str:
9+
import oracledb
10+
soda_config = to_oracle_soda_configuration(server)
11+
12+
oracle_client_dir = os.getenv("DATACONTRACT_ORACLE_CLIENT_DIR")
13+
if oracle_client_dir is not None:
14+
# Soda Core currently does not support thick mode natively, see https://github.com/sodadata/soda-core/issues/2036
15+
# but the oracledb client can be configured accordingly before Soda initializes as a work-around
16+
oracledb.init_oracle_client(lib_dir=oracle_client_dir)
17+
18+
return soda_config
19+
20+
821
def to_oracle_soda_configuration(server: Server) -> str:
922
"""Serialize server config to soda configuration.
1023

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "datacontract-cli"
3-
version = "0.10.38"
3+
version = "0.10.39"
44
description = "The datacontract CLI is an open source command-line tool for working with Data Contracts. It uses data contract YAML files to lint the data contract, connect to data sources and execute schema and quality tests, detect breaking changes, and export to different formats. The tool is written in Python. It can be used as a standalone CLI tool, in a CI/CD pipeline, or directly as a Python library."
55
license = "MIT"
66
readme = "README.md"

0 commit comments

Comments
 (0)