Skip to content

Commit

Permalink
Merge pull request #461 from cody-scott/dev
Browse files Browse the repository at this point in the history
Incorporate 1.7.2 changes
  • Loading branch information
schlich authored Jan 25, 2024
2 parents 9546c40 + 66fedda commit 2421fe9
Show file tree
Hide file tree
Showing 64 changed files with 501 additions and 1,556 deletions.
9 changes: 9 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "2.7.1",
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:f6a73ee06601d703db7d95d03e415cab229e78df92bb5002e8559bcfc047fec6",
"integrity": "sha256:f6a73ee06601d703db7d95d03e415cab229e78df92bb5002e8559bcfc047fec6"
}
}
}
11 changes: 11 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:1-3.10-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postStartCommand": "bash .devcontainer/setup_odbc.sh && bash .devcontainer/install_pyenv.sh && bash .devcontainer/setup_env.sh",
"runArgs": [
"--env-file", "${localWorkspaceFolder}/.devcontainer/test.env"
]
}
6 changes: 6 additions & 0 deletions .devcontainer/install_pyenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#/bin/bash
curl https://pyenv.run | bash

echo 'export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"' >> ~/.bashrc
6 changes: 6 additions & 0 deletions .devcontainer/setup_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pyenv install 3.10.7
pyenv virtualenv 3.10.7 dbt-sqlserver
pyenv activate dbt-sqlserver

make dev
make server
18 changes: 18 additions & 0 deletions .devcontainer/setup_odbc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc

#Download appropriate package for the OS version
#Choose only ONE of the following, corresponding to your OS version

#Debian 12
curl https://packages.microsoft.com/config/debian/12/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list

sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
# optional: kerberos library for debian-slim distributions
sudo apt-get install -y libgssapi-krb5-2
104 changes: 0 additions & 104 deletions .github/workflows/integration-tests-azure.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-sqlserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python_version: ["3.8", "3.9", "3.10", "3.11"]
msodbc_version: ["17", "18"]
sqlserver_version: ["2017", "2019", "2022"]
collation: ["SQL_Latin1_General_CP1_CS_AS", "SQL_Latin1_General_CP1_CI_AS"]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Unit tests
strategy:
matrix:
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python_version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ venv/
ENV/
env.bak/
venv.bak/
.mise.toml
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3.9
python: python3.10
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v4.4.0
Expand Down Expand Up @@ -62,7 +62,7 @@ repos:
- manual
args:
- '--line-length=99'
- '--target-version=py39'
- '--target-version=py310'
- '--check'
- '--diff'
- repo: 'https://github.com/pycqa/flake8'
Expand Down Expand Up @@ -94,4 +94,5 @@ repos:
- '--show-error-codes'
- '--pretty'
- '--ignore-missing-imports'
- '--explicit-package-bases'
files: '^dbt/adapters'
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

### v1.7.2

Updated to use dbt-fabric as the upstream adapter (https://github.com/dbt-msft/dbt-sqlserver/issues/441#issuecomment-1815837171)[https://github.com/dbt-msft/dbt-sqlserver/issues/441#issuecomment-1815837171] and (https://github.com/microsoft/dbt-fabric/issues/105)[https://github.com/microsoft/dbt-fabric/issues/105]

As the fabric adapter implements the majority of auth and required t-sql, this adapter delegates primarily to SQL auth and SQL Server specific
adaptations (using `SELECT INTO` vs `CREATE TABLE AS`).

Additional major changes pulled from fabric adapter:

* `TIMESTAMP` changing from `DATETIMEOFFSET` to `DATETIME2(6)`
* `STRING` changing from `VARCHAR(MAX)` to `VARCHAR(8000)`


#### Future work to be validated

* Fabric specific items that need further over-rides (clone for example needed overriding)
* Azure Auth elements to be deferred to Fabric, but should be validated
* T-SQL Package to be updated and validated with these changes.

### v1.4.3

Another minor release to follow up on the 1.4 releases.
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ make help
[Pre-commit](https://pre-commit.com/) helps us to maintain a consistent style and code quality across the entire project.
After running `make dev`, pre-commit will automatically validate your commits and fix any formatting issues whenever possible.

## Devcontainer

A devcontainer file has been added since 1.7.2 to simpify creating the development environment.

## Testing

The functional tests require a running SQL Server instance. You can easily spin up a local instance with the following command:
Expand Down
1 change: 1 addition & 0 deletions dbt/adapters/sqlserver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
adapter=SQLServerAdapter,
credentials=SQLServerCredentials,
include_path=sqlserver.PACKAGE_PATH,
dependencies=["fabric"],
)

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/sqlserver/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.4.3"
version = "1.7.2"
Loading

0 comments on commit 2421fe9

Please sign in to comment.