Skip to content

Commit

Permalink
Merge pull request #171 from microsoft/1.4.0-upgrade
Browse files Browse the repository at this point in the history
1.4.0 Upgrade
  • Loading branch information
prdpsvs authored Oct 11, 2023
2 parents 475b160 + c1ed728 commit c57c40b
Show file tree
Hide file tree
Showing 19 changed files with 20,327 additions and 47 deletions.
35 changes: 6 additions & 29 deletions .github/workflows/integration-tests-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ on: # yamllint disable-line rule:truthy
branches:
- master
- v*
pull_request_target:
types: [labeled]
pull_request:
branches:
- master

jobs:
integration-tests-azure:
name: Integration tests on Azure
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || github.ref_name == 'master' || startsWith(github.ref_name, 'v')
strategy:
max-parallel: 1
matrix:
python_version: ["3.7", "3.8", "3.9", "3.10"]
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
msodbc_version: ["17", "18"]
runs-on: ubuntu-latest
container:
Expand All @@ -26,28 +25,6 @@ jobs:
- name: Install dependencies
run: pip install -r dev_requirements.txt

- name: Resume server
env:
DBT_SYNAPSE_SERVER: ${{ secrets.DBT_SYNAPSE_SERVER }}
DBT_SYNAPSE_DB: ${{ secrets.DBT_SYNAPSE_DB }}
AZURE_CLIENT_ID: ${{ secrets.DBT_AZURE_SP_NAME }}
AZURE_CLIENT_SECRET: ${{ secrets.DBT_AZURE_SP_SECRET }}
AZURE_TENANT_ID: ${{ secrets.DBT_AZURE_TENANT }}
DBT_AZURE_RESOURCE_GROUP_NAME: ${{ secrets.DBT_AZURE_RESOURCE_GROUP_NAME }}
DBT_AZURE_SUBSCRIPTION_ID: ${{ secrets.DBT_AZURE_SUBSCRIPTION_ID }}
run: python devops/synapse.py resume

- name: Configure test users
run: sqlcmd -b -I -i devops/create_sql_users.sql
env:
DBT_TEST_USER_1: DBT_TEST_USER_1
DBT_TEST_USER_2: DBT_TEST_USER_2
DBT_TEST_USER_3: DBT_TEST_USER_3
SQLCMDUSER: ${{ secrets.DBT_SYNAPSE_UID }}
SQLCMDPASSWORD: ${{ secrets.DBT_SYNAPSE_PWD }}
SQLCMDSERVER: ${{ secrets.DBT_SYNAPSE_SERVER }}.sql.azuresynapse.net
SQLCMDDBNAME: ${{ secrets.DBT_SYNAPSE_DB }}

- name: Run functional tests
env:
DBT_SYNAPSE_SERVER: ${{ secrets.DBT_SYNAPSE_SERVER }}
Expand All @@ -58,7 +35,7 @@ jobs:
DBT_TEST_USER_1: DBT_TEST_USER_1
DBT_TEST_USER_2: DBT_TEST_USER_2
DBT_TEST_USER_3: DBT_TEST_USER_3
DBT_TEST_AAD_PRINCIPAL_1: ${{ secrets.DBT_TEST_AAD_PRINCIPAL_1 }}
DBT_TEST_AAD_PRINCIPAL_2: ${{ secrets.DBT_TEST_AAD_PRINCIPAL_2 }}
DBT_TEST_AAD_PRINCIPAL_1: DBT_TEST_AAD_PRINCIPAL_1
DBT_TEST_AAD_PRINCIPAL_2: DBT_TEST_AAD_PRINCIPAL_2
SYNAPSE_TEST_DRIVER: 'ODBC Driver ${{ matrix.msodbc_version }} for SQL Server'
run: pytest -ra -v tests/functional --profile "ci_azure_auto"
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: mixed-line-ending
- id: check-docstring-first
- repo: 'https://github.com/adrienverge/yamllint'
rev: v1.28.0
rev: v1.31.0
hooks:
- id: yamllint
args:
Expand All @@ -32,13 +32,13 @@ repos:
hooks:
- id: absolufy-imports
- repo: 'https://github.com/hadialqattan/pycln'
rev: v2.1.2
rev: v2.1.3
hooks:
- id: pycln
args:
- '--all'
- repo: 'https://github.com/pycqa/isort'
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
args:
Expand All @@ -50,7 +50,7 @@ repos:
- '--python-version'
- '39'
- repo: 'https://github.com/psf/black'
rev: 22.10.0
rev: 23.3.0
hooks:
- id: black
args:
Expand Down Expand Up @@ -78,7 +78,7 @@ repos:
stages:
- manual
- repo: 'https://github.com/pre-commit/mirrors-mypy'
rev: v0.991
rev: v1.2.0
hooks:
- id: mypy
args:
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# Changelog
## v1.4.0

#### Features

* Support for [dbt-core 1.4](https://github.com/dbt-labs/dbt-core/releases/tag/v1.4.0)
* [Incremental predicates](https://docs.getdbt.com/docs/build/incremental-models#about-incremental_predicates)
* Add support for Python 3.11
* Replace deprecated exception functions
* Consolidate timestamp macros

#### Under the hood

* View https://github.com/dbt-msft/dbt-sqlserver/blob/v1.4.latest/CHANGELOG.md#v140 for latest bugfixes in dbt-sqlserver adapter.
* Added all available tests as of dbt 1.4.6

**Full Changelog**: https://github.com/microsoft/dbt-synapse/compare/v1.3.2...v1.4.0

## v1.3.2

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ See [the changelog](CHANGELOG.md)

## Contributing

[![Integration tests on Azure](https://github.com/dbt-msft/dbt-synapse/actions/workflows/integration-tests-azure.yml/badge.svg)](https://github.com/dbt-msft/dbt-sqlserver/actions/workflows/integration-tests-azure.yml)
[![Integration tests on Azure](https://github.com/microsoft/dbt-synapse/actions/workflows/integration-tests-azure.yml/badge.svg)](https://github.com/dbt-msft/dbt-sqlserver/actions/workflows/integration-tests-azure.yml)

This adapter is community-maintained.
This adapter is managed by Microsoft.
You are welcome to contribute by creating issues, opening or reviewing pull requests or helping other users in Slack channel.
If you're unsure how to get started, check out our [contributing guide](CONTRIBUTING.md).

Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/synapse/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.3.2"
version = "1.4.0"
5 changes: 2 additions & 3 deletions dbt/include/synapse/macros/materializations/seeds/helpers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
WITH (DISTRIBUTION = {{dist}}, {{index}})
{% endset %}

{% call statement('_') -%}
{{ sql }}
{%- endcall %}
Expand All @@ -29,8 +28,8 @@
{% macro synapse__load_csv_rows(model, agate_table) %}

{# Synapse does not support the normal Table Value Constructor #}

{% set batch_size = get_batch_size() %}
--
{% set batch_size = get_batch_size() %}

{% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}

Expand Down
9 changes: 6 additions & 3 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
pytest==7.2.0
twine==4.0.2
wheel==0.38.4
pre-commit==2.20.0
wheel==0.40.0
pre-commit==2.21.0;python_version<"3.8"
pre-commit==3.3.1;python_version>="3.8"
pytest-dotenv==0.5.2
dbt-tests-adapter==1.3.1
dbt-tests-adapter~=1.4.5
aiohttp==3.8.3
azure-mgmt-synapse==2.0.0
flaky==3.7.0
pytest-xdist==3.3.0
-e .
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@
from setuptools.command.install import install

package_name = "dbt-synapse"
authors_list = ["Nandan Hegde", "Chaerin Lee", "Alieu Sanneh", "Anders Swanson", "Sam Debruyn"]
dbt_version = "1.3"
dbt_sqlserver_requirement = "dbt-sqlserver~=1.3.0"
authors_list = [
"Pradeep Srikakolapu",
"Nandan Hegde",
"Chaerin Lee",
"Alieu Sanneh",
"Anders Swanson",
"Sam Debruyn",
]
dbt_version = "1.4"
dbt_sqlserver_requirement = "dbt-sqlserver~=1.4.0"
description = """An Azure Synapse adapter plugin for dbt"""

this_directory = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -80,5 +87,6 @@ def run(self):
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def pytest_addoption(parser):
parser.addoption("--profile", action="store", default="user", type=str)
parser.addoption("--profile", action="store", default="user_azure", type=str)


@pytest.fixture(scope="class")
Expand Down
Loading

0 comments on commit c57c40b

Please sign in to comment.