Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR Is stuck. I don't know what the path forward is.
From our version to this version we gain:
TypeGuard
from 3.10 (and typing extensions) which can be used to replace some uses ofisinstance
for type narrowingtype()
not justisinstance
--exclude
flag for specifying modulesThe two big issues with getting this to work:
Fix for 1: add empty
__init__.py
files to the following directories:Fix for 2: remove the
__init__.py
files from the following directories:This means we have one of two things breaking at any given time. Either mypy fails because we it detects an error with the way we've named our modules because it's not traversing them all, or tests fail to import the postgres adapter from
dbt.adapters.postgres
. With 1 fixed, and 2 failing,dbt run
still works after install, so it's likely tests are failing because of test setup when the only change that has been made is adding init files to the context and deps packages.The reason the import mechanism is unknown is because the postgres adapter lives in the plugin directory. When you run
pip install dbt-postgres
, it installs dbt-core, then finds the postgres adapter in the plugins directory and copies those modules to the pathdbt/core/adapters/postgres
so they can be imported likefrom dbt.adapters.postgres import PostgresAdapter
. When you manually inspect the virtual environment after doing a freshpip install -r dev-requirements.txt -r editable-requirements.txt
, which is what both the makefile and tox are doing, the adapter modules have not been moved to that location yet the tests still run and import the adapter just fine.If we cannot find a path forward to make both mypy and unit tests pass, we may have to abandon this upgrade.
Checklist
CHANGELOG.md
and added information about my change