dbt (data build tool) adapter for SAS
Project description
SAS DBT adapter
The dbt-sas package allows dbt to connect to SAS.
Installation
pip install dbt-sas
Configurations
Basic profile.yml
for connecting to SAS:
sas-test:
outputs:
dev:
type: sas
host: SAS host
port: 8591
database: sas (keep 'sas', don't change)
schema: default libray name
user: SAS username
password: SAS password
autoexec: optional local path of autoexec.sas file
lib_base_path: optional path (on the SAS server) for new libraries
threads: 1
fail_on_warnings: False
lib_name_strict_mode: False
target: dev
Key | Required | Description |
---|---|---|
type |
Yes | The specific adapter to use (sas ) |
host |
Yes | SAS server hostname |
port |
Yes | SAS server port |
database |
Yes | sas , don't change |
schema |
Yes | Default SAS libname |
username |
Yes | The username to use to connect to the server |
password |
Yes | The password to use for authenticating to the server |
handler |
Yes | SAS handler ws (default) or saspy |
autoexec |
No | Local path of autoexec.sas file |
lib_base_path |
No | Base path on the SAS server for new libraries |
fail_on_warnings |
No | Raise and error if it encounters a warning |
lib_name_strict_mode |
No | Enable strict libname/identifier check |
Features
Key | Supported | Description |
---|---|---|
Tests | Yes | Run dbt tests on SAS |
Load seed files | Yes | Load seeds from CSV files to SAS |
View Materialization | Yes | Materialize dbt models as views in SAS |
Table Materialization | Yes | Materialize dbt models as tables in SAS |
Ephemeral Materialization | Partial | Materialize dbt ephemeral tables as temporary views in SAS |
Incremental Materialization | No | |
Snapshots | No | |
Grants | No | SQL grants are not supported by SAS |
Limitations
- Schemas (lib names) are limited to 8 characters.
- Table names, column names, and aliases are limited to 32 characters.
Usage
- Create dbt project, choose sas database and set up connection
$ dbt init <project_name>
Testing
- Install dev requirements
$ pip install -r dev_requirements.txt
- Run pytest
$ python -m pytest tests/
Logging
export DBT_SAS_LOG='file.log'
export DBT_SAS_FAMILY='sas,sql'
export DBT_SAS_FAMILY='sas,sql,original_sql'
TODO
$ make venv
$ source ./bin/activate
$ python
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import saspy
>>> sas=saspy.SASsession(java='/usr/bin/java', iomhost='***', iomport=8591, omruser='***', omrpw='***')
Using SAS Config named: default
SAS Connection established. Subprocess id is 1139816
>>>
Licence
Apache License, Version 2.0
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dbt-sas-1.3.0a6.tar.gz
(25.3 kB
view hashes)
Built Distribution
Close
Hashes for dbt_sas-1.3.0a6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0fe8e8e173d2e435530f942e91bb5da112e01f3a7dcc7b8d4dfb61af7a6e9e6 |
|
MD5 | dea1b117d62c7fc28b8bae01b02af7bf |
|
BLAKE2b-256 | ef42f964c9952a963ba36b8fa162c43b3537cd6a305e4ecdf731cb706ded2e96 |