Skip to content

Commit

Permalink
Merge pull request #66 from microsoft/v1.6.0
Browse files Browse the repository at this point in the history
dbt 1.6.0 update
  • Loading branch information
prdpsvs authored Sep 12, 2023
2 parents 1322303 + ca5b171 commit 89d59ca
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
AZURE_CLIENT_SECRET: ${{ secrets.DBT_AZURE_SP_SECRET }}
AZURE_TENANT_ID: ${{ secrets.DBT_AZURE_TENANT }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: pip install -r dev_requirements.txt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/[email protected]
Expand All @@ -31,7 +31,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v4.2.1
with:
context: devops
build-args: PYTHON_VERSION=${{ matrix.python_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Release new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
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 @@ -28,7 +28,7 @@ jobs:
password: ${{ secrets.github_token }}
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: pip install -r dev_requirements.txt
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

### v1.6.0

## Features

* Supporting dbt-core 1.6.2
* Adding limit - new args to adapter.execute() function
* Added tests related to dbt-debug to test --connection parameter
* Added adapter zone tests

## Dependencies

* Bump from pytest==7.4.0 to pytest==7.4.2
* Bump from pre-commit==3.3.3 to 3.4.0
* Bump from dbt-tests-adapter~=1.5.2 to 1.6.2
* Bump from actions@v3 to v4
* Bump from [email protected] to 4.2.1
### v1.5.0

Releasing 1.5 version for dbt-cloud integration.
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/fabric/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.5.0"
version = "1.6.0"
4 changes: 2 additions & 2 deletions dbt/adapters/fabric/fabric_connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def data_type_code_to_name(cls, type_code: Union[str, str]) -> str:
return datatypes[data_type]

def execute(
self, sql: str, auto_begin: bool = True, fetch: bool = False
self, sql: str, auto_begin: bool = True, fetch: bool = False, limit: Optional[int] = None
) -> Tuple[AdapterResponse, agate.Table]:
_, cursor = self.add_query(sql, auto_begin)
response = self.get_response(cursor)
Expand All @@ -505,7 +505,7 @@ def execute(
while cursor.description is None:
if not cursor.nextset():
break
table = self.get_result_from_cursor(cursor)
table = self.get_result_from_cursor(cursor, limit)
else:
table = empty_table()
# Step through all result sets so we process all errors
Expand Down
6 changes: 3 additions & 3 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pytest==7.4.0
pytest==7.4.2
twine==4.0.2
wheel==0.41.1
pre-commit==2.21.0;python_version<"3.8"
pre-commit==3.3.3;python_version>="3.8"
pre-commit==3.4.0;python_version>="3.8"
pytest-dotenv==0.5.2
dbt-tests-adapter~=1.5.2
dbt-tests-adapter~=1.6.2
flaky==3.7.0
pytest-xdist==3.3.1
-e .
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package_name = "dbt-fabric"
authors_list = ["Pradeep Srikakolapu"]
dbt_version = "1.5"
dbt_version = "1.6"
description = """A Microsoft Fabric Synapse Data Warehouse adapter plugin for dbt"""

this_directory = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -66,7 +66,7 @@ def run(self):
packages=find_namespace_packages(include=["dbt", "dbt.*"]),
include_package_data=True,
install_requires=[
"dbt-core~=1.5.2",
"dbt-core~=1.6.2",
"pyodbc~=4.0.35,!=4.0.36,!=4.0.37",
"azure-identity>=1.12.0",
],
Expand Down
20 changes: 19 additions & 1 deletion tests/functional/adapter/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import yaml
from dbt.cli.exceptions import DbtUsageException
from dbt.tests.adapter.dbt_debug.test_dbt_debug import BaseDebug, BaseDebugProfileVariable
from dbt.tests.util import run_dbt
from dbt.tests.util import run_dbt, run_dbt_and_capture


class TestDebugFabric(BaseDebug):
Expand All @@ -17,6 +17,24 @@ def test_nopass(self, project):
run_dbt(["debug", "--target", "nopass"], expect_pass=False)
self.assertGotValue(re.compile(r"\s+profiles\.yml file"), "ERROR invalid")

def test_connection_flag(self, project):
"""Testing that the --connection flag works as expected, including that output is not lost"""
_, out = run_dbt_and_capture(["debug", "--connection"])
assert "Skipping steps before connection verification" in out

_, out = run_dbt_and_capture(
["debug", "--connection", "--target", "NONE"], expect_pass=False
)
assert "1 check failed" in out
assert "The profile 'test' does not have a target named 'NONE'." in out

_, out = run_dbt_and_capture(
["debug", "--connection", "--profiles-dir", "NONE"], expect_pass=False
)
assert "Using profiles dir at NONE"
assert "1 check failed" in out
assert "dbt looked for a profiles.yml file in NONE" in out

def test_wronguser(self, project):
run_dbt(["debug", "--target", "wronguser"], expect_pass=False)
self.assertGotValue(re.compile(r"\s+Connection test"), "ERROR")
Expand Down
5 changes: 5 additions & 0 deletions tests/functional/adapter/test_equals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.utils.test_equals import BaseEquals


class TestEqualsFabric(BaseEquals):
pass
9 changes: 9 additions & 0 deletions tests/functional/adapter/test_null_compare.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from dbt.tests.adapter.utils.test_null_compare import BaseMixedNullCompare, BaseNullCompare


class TestMixedNullCompareFabric(BaseMixedNullCompare):
pass


class TestNullCompareFabric(BaseNullCompare):
pass

0 comments on commit 89d59ca

Please sign in to comment.