Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to dbt-core 1.4. #146

Merged
merged 7 commits into from
Jun 11, 2023
Merged

Upgraded to dbt-core 1.4. #146

merged 7 commits into from
Jun 11, 2023

Conversation

lpezet
Copy link
Contributor

@lpezet lpezet commented Apr 21, 2023

resolves #122

Description

Upgrading to dbt-core 1.4:

  • now using field() from dataclasses package for policy fields definition. Consequently updated code to then use get_default_include_policy() to access class field
  • using DbtRuntimeError instead of RuntimeException
  • using FailedToConnectError instead of FailedToConnectException
  • using dbt.exceptions.DbtDatabaseError instead of dbt.exceptions.DatabaseException
  • updated requirements-dev.txt to use dbt-core 1.4.latest
  • using dbt.exceptions.CompilationError instead of deprecated dbt.exceptions.raise_compiler_error

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md with information about my change

@lpezet
Copy link
Contributor Author

lpezet commented Apr 21, 2023

@dbeatty10 Not sure whether this project is still (even if sporadically) maintained but I'm in need to using dbt-mysql with dbt-core 1.4.
I'm having issues getting the docker-compose up and running (it starts but then each db says something is already running on their 3306 port) and I haven't figured out how to fix that yet. All good now.
Having sait that, the following tests pass:

  • Unit tests
  • Functional tests for mysql, mysql5, and mariadb using docker-compose.

Copy link

@moszutij moszutij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be beneficial to substitute the deprecated function dbt.exceptions.raise_compiler_error with dbt.exceptions.CompilationError in the */impl.py files.

@dbeatty10
Copy link
Owner

🚀 Thank you for your work here @lpezet !

I won't be able to spend time this week on reviewing this, but can give it a review next week.

@lpezet
Copy link
Contributor Author

lpezet commented Apr 24, 2023

@moszutij Thanks. I just made those changes. Weird my VSCode didn't catch those...
@dbeatty10 Awesome! Thx!

@BamboOSZ
Copy link

👀

@wesen
Copy link

wesen commented May 8, 2023

I was just trying this one out @lpezet , and I think dbt.exceptions.DatabaseException needs to be updated to dbt.exceptions.DbtDatabaseError. I haven't done a deeper dive, just running my setup through it.

@lpezet
Copy link
Contributor Author

lpezet commented May 8, 2023

@wesen Thanks. I'll fix those. My VSCode somehow is not showing those. If you have any good setup to share (linter, etc.) that would be great.

@wesen
Copy link

wesen commented May 9, 2023

@lpezet I use intellij idea/pycharm, but in this case just saw it by... writing bad SQL :)

@uraurora
Copy link

Why this pr not being merged? Any progress now?

Copy link
Owner

@dbeatty10 dbeatty10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lpezet!

@dbeatty10 dbeatty10 merged commit 3db05eb into dbeatty10:main Jun 11, 2023
@lucasfcnunes
Copy link

I can't find the 1.4 release

@outinim
Copy link

outinim commented Nov 8, 2023

Why is the 1.4 version is not linked to the main branch ? cc @dbeatty10 🙏🏼
What do you need to update the release ?

mwallace582 added a commit that referenced this pull request Jan 9, 2024
mwallace582 pushed a commit that referenced this pull request Jan 9, 2024
* Upgraded to dbt-core 1.4.

* Updated CHANGELOG.

* Fixed policy fields definitions for mariadb and mysql5.

* Replaced deprecated dbt.exceptions.raise_compiler_error() with dbt.exceptions.CompilationError.

* Now using dbt.exceptions.DbtDatabaseError insead of dbt.exceptions.DatabaseException.

* Update version

* Update changelog

---------

Co-authored-by: Doug Beatty <[email protected]>
mwallace582 added a commit that referenced this pull request Jan 17, 2024
* Revert "Upgraded to dbt-core 1.4. (#146)"

This reverts commit 3db05eb.

* Fix version bumping

* Migration bump2version (unmaintained) to bump-my-version
* Import `bumpversion.cfg` from `dbt-snowflake`
* Convert `bumpversion.cfg` to `bumpversion.toml`
* Fix a few incorrect version labels

* Remove macos and windows as integration targets

* Fix requirements conflict between dbt 1.2 and tox

* Bump version to 1.3

* Upgraded to dbt-core 1.4. (#146)

* Upgraded to dbt-core 1.4.

* Updated CHANGELOG.

* Fixed policy fields definitions for mariadb and mysql5.

* Replaced deprecated dbt.exceptions.raise_compiler_error() with dbt.exceptions.CompilationError.

* Now using dbt.exceptions.DbtDatabaseError insead of dbt.exceptions.DatabaseException.

* Update version

* Update changelog

---------

Co-authored-by: Doug Beatty <[email protected]>

* Bump version to 1.5

* Update dbt-core to 1.5 and implement support for model contracts (#163)

Update dbt-core to 1.5.9 and implement support for constraints
* Update changelog
* Fix unit test error
     - The error was: `AttributeError: 'Namespace' object has no attribute 'MACRO_DEBUGGING'`
* Allow Unix socket connection rather than just TCP (#165)

* Support Black & MyPy pre-commit hooks (#167)

* Add black and mypy as pre-commit hooks

* Run black formatter on all files

* Add MyPy configuration & make tweaks and ignore errors to make MyPy pass

* Add .git-blame-ignore-revs to ignore `black` changes in git blame

* Update changelog

* Run black formatter on all files

* Add black commit to .git-blame-ignore-revs

* Run black formatter on all files

* Add black commit to .git-blame-ignore-revs

* Fix MyPy & black errors

* Make the `database` config field nullable again

* Fix mypy

* Bump version to 1.6

* Bump version to 1.7

* Fix import error

---------

Co-authored-by: Luke <[email protected]>
Co-authored-by: Doug Beatty <[email protected]>
mwallace582 added a commit that referenced this pull request Apr 26, 2024
* Revert "Upgraded to dbt-core 1.4. (#146)"

This reverts commit 3db05eb.

* Fix version bumping

* Migration bump2version (unmaintained) to bump-my-version
* Import `bumpversion.cfg` from `dbt-snowflake`
* Convert `bumpversion.cfg` to `bumpversion.toml`
* Fix a few incorrect version labels

* Remove macos and windows as integration targets

* Fix requirements conflict between dbt 1.2 and tox

* Bump version to 1.3

* Upgraded to dbt-core 1.4. (#146)

* Upgraded to dbt-core 1.4.

* Updated CHANGELOG.

* Fixed policy fields definitions for mariadb and mysql5.

* Replaced deprecated dbt.exceptions.raise_compiler_error() with dbt.exceptions.CompilationError.

* Now using dbt.exceptions.DbtDatabaseError insead of dbt.exceptions.DatabaseException.

* Update version

* Update changelog

---------

Co-authored-by: Doug Beatty <[email protected]>

* Bump version to 1.5

* Update dbt-core to 1.5 and implement support for model contracts (#163)

Update dbt-core to 1.5.9 and implement support for constraints
* Update changelog
* Fix unit test error
     - The error was: `AttributeError: 'Namespace' object has no attribute 'MACRO_DEBUGGING'`
* Allow Unix socket connection rather than just TCP (#165)

* Support Black & MyPy pre-commit hooks (#167)

* Add black and mypy as pre-commit hooks

* Run black formatter on all files

* Add MyPy configuration & make tweaks and ignore errors to make MyPy pass

* Add .git-blame-ignore-revs to ignore `black` changes in git blame

* Update changelog

* Run black formatter on all files

* Add black commit to .git-blame-ignore-revs

* Run black formatter on all files

* Add black commit to .git-blame-ignore-revs

* Fix MyPy & black errors

* Make the `database` config field nullable again

* Fix mypy

* Bump version to 1.6

* Bump version to 1.7

* Fix import error

* Fix unicode decode error (#169)

* Update setup.py

Explicitly defining utf-8 encoding to avoid UnicodeDecodeError on setup.py in Windows environment

* Update CHANGELOG.md

---------

Co-authored-by: Scott Gunn <[email protected]>

* Pin jsonschema version to fix tests (#174)

* Add collation support in profiles.yml / Fix incorrect collation for utf8mb4 (#173)

* Add support for charset and collation in profile.yml

* Change mysql-connect-python version

* Update readme with new profile options

* Update setup.py with less restricting mysql-connector-python version after code review

Co-authored-by: Matthew Wallace <[email protected]>

* Add collation and charset support for mariadb and mysql5

---------

Co-authored-by: Matthew Wallace <[email protected]>

* Pin jsonschema version to fix tests

* Update black to resolve security alert

https://github.com/dbeatty10/dbt-mysql/security/dependabot/5

---------

Co-authored-by: Luke <[email protected]>
Co-authored-by: Doug Beatty <[email protected]>
Co-authored-by: Scott Gunn <[email protected]>
Co-authored-by: Krzysztof Zajączkowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upgrade to support dbt-core v1.4.0
8 participants