Skip to content

Commit

Permalink
Include py.typed in MANIFEST.in (#5703)
Browse files Browse the repository at this point in the history
This enables packages that install dbt-core from pypi to use mypy.
  • Loading branch information
panasenco authored and Axel Goblet committed Sep 16, 2022
1 parent 713be18 commit b765429
Show file tree
Hide file tree
Showing 3 changed files with 20,078 additions and 1 deletion.
1 change: 0 additions & 1 deletion core/dbt/config/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class Profile(HasCredentials):
threads: int
credentials: Credentials
profile_env_vars: Dict[str, Any]
manage_schemas: Optional[bool]

def __init__(
self,
Expand Down
77 changes: 77 additions & 0 deletions tests/functional/schema_management/test_drop_dangling_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import pytest
import os

from dbt.tests.util import (
run_dbt,
check_table_does_exist,
check_table_does_not_exist,
)

model = """
{{
config(
materialized = "table"
)
}}
SELECT * FROM (
VALUES (1, 'one'),
(2, 'two'),
(3, 'three')
) AS t (num,letter)
"""



class TestDanglingModels:

@pytest.fixture(scope="class")
def models(self):
return {
"model_a.sql": model,
"model_b.sql": model,
}


@pytest.fixture(scope="class")
def dbt_profile_target(self):
return {
"type": "postgres",
"threads": 4,
"host": "localhost",
"port": int(os.getenv("POSTGRES_TEST_PORT", 5432)),
"user": os.getenv("POSTGRES_TEST_USER", "root"),
"pass": os.getenv("POSTGRES_TEST_PASS", "password"),
"dbname": os.getenv("POSTGRES_TEST_DATABASE", "dbt"),
"manage_schemas": True,
}

@pytest.fixture(scope="class")
def project_config_update(self, unique_schema):
return {
"managed-schemas": [
{
"database": os.getenv("POSTGRES_TEST_DATABASE", "dbt"),
"schema": unique_schema,
"action": "drop",
}
]
}


def test_drop(
self,
project,
):
# create numbers model
run_dbt(["run"])
check_table_does_exist(project.adapter, "model_a")
check_table_does_exist(project.adapter, "model_b")
check_table_does_not_exist(project.adapter, "baz")

# remove numbers model
project.update_models({
"model_b.sql": model,
})
run_dbt(["run"])
check_table_does_not_exist(project.adapter, "model_a")
check_table_does_exist(project.adapter, "model_b")
Loading

0 comments on commit b765429

Please sign in to comment.