Skip to main content

dbt (data build tool) adapter for SAS

Project description

SAS DBT adapter

Build Status PyPI version PyPI License Code style: black

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>

Query Logging

Enable additional logging by setting the DBT_SAS_LOG environment variable to the log filename, e.g.:

export DBT_SAS_LOG='file.log'

Select the log families, e.g.:

export DBT_SAS_FAMILY='sas,sql'

Log families are:

  • sas
  • sql
  • original_sql

Adapter Testing

  • Install dev requirements
$ pip install -r dev_requirements.txt
  • Run pytest
$ python -m pytest tests/

Licence

Apache License, Version 2.0

Links

Project details


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.0a16.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

dbt_sas-1.3.0a16-py2.py3-none-any.whl (40.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dbt-sas-1.3.0a16.tar.gz.

File metadata

  • Download URL: dbt-sas-1.3.0a16.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for dbt-sas-1.3.0a16.tar.gz
Algorithm Hash digest
SHA256 6df4f415112f53828f472f114d672522f37c39a1b6c6ad62a4f85f5f49655739
MD5 f87f02cff9434ba366b52d1abfd1effc
BLAKE2b-256 c3dc17c38fcc86fff81489d29510d5f021b997c204abd873f4eb012ffb0f0f97

See more details on using hashes here.

File details

Details for the file dbt_sas-1.3.0a16-py2.py3-none-any.whl.

File metadata

  • Download URL: dbt_sas-1.3.0a16-py2.py3-none-any.whl
  • Upload date:
  • Size: 40.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for dbt_sas-1.3.0a16-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 33966c5b007ffd70a4cda6ec4b52a28193f54cb60c63d11e0d85add540bc6c3b
MD5 04f84d804f8af16a1e6c7844458e57dc
BLAKE2b-256 7563f51f19a8f4471e8fbad9961492383fdb81a249c524267aef1b8ab81b9eca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page