Issue Description
When reading exposure data from a SQL Server database using a custom port, the connection fails.
Steps to Reproduce (Bugs only)
Here's the config file.
transformations:
loc: # Transformation name
input_format:
name: Cede_Location
version: 10.0.0
output_format:
name: OED_Location
version: 3.0.2
runner:
batch_size: 750000 # Number of rows to process in a single batch
extractor:
type: mssql # Path to the DB connection file. Other options are 'postgres' and 'sqlite'. Defaults to 'csv', when not present.
options:
host: myserver
port: 1450
database: MY_DB
user: foo
password: bar
sql_statement: ./cede_location.sql # SQL statement to extract data
loader:
options:
path: ./CF_oed_location.csv # Path to the output file
quoting: minimal
And the command used:
ods_tools transform --config-file /path/to/CF_config.yaml
The output is:
2024-10-28 16:18:13,612 - ERROR - DBConnectionError(), line 160 in /home/carl/venvs/myvenv/lib/python3.10/site-packages/ods_tools/odtf/controller.py
Version / Environment information
Example data / logs
This can be fixed by setting the port as part of the server string:
host: myserver,1450
port:
But would perhaps be better done in code at
|
"DRIVER={};SERVER={};PORT={};DATABASE={};UID={};PWD={}".format( |
.
conn = pyodbc.connect(
"DRIVER={};SERVER={},{};DATABASE={};UID={};PWD={}".format(
self.driver,
database["host"],
database["port"],
database["database"],
database["user"],
database["password"],
)
)
Issue Description
When reading exposure data from a SQL Server database using a custom port, the connection fails.
Steps to Reproduce (Bugs only)
Here's the config file.
And the command used:
The output is:
Version / Environment information
Example data / logs
This can be fixed by setting the port as part of the server string:
But would perhaps be better done in code at
ODS_Tools/ods_tools/odtf/connector/db/mssql.py
Line 28 in 02c9e22