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

Wraps run_dbt_ function in sync_compatible #15740

Merged
merged 5 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/integrations/prefect-dbt/prefect_dbt/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def _compile_kwargs(self, **open_kwargs: Dict[str, Any]) -> Dict[str, Any]:


@task
@sync_compatible
EmilRex marked this conversation as resolved.
Show resolved Hide resolved
async def run_dbt_build(
profiles_dir: Optional[Union[Path, str]] = None,
project_dir: Optional[Union[Path, str]] = None,
Expand Down Expand Up @@ -471,6 +472,7 @@ def dbt_test_flow():


@task
@sync_compatible
async def run_dbt_model(
profiles_dir: Optional[Union[Path, str]] = None,
project_dir: Optional[Union[Path, str]] = None,
Expand Down Expand Up @@ -545,6 +547,7 @@ def dbt_test_flow():


@task
@sync_compatible
async def run_dbt_test(
profiles_dir: Optional[Union[Path, str]] = None,
project_dir: Optional[Union[Path, str]] = None,
Expand Down Expand Up @@ -619,6 +622,7 @@ def dbt_test_flow():


@task
@sync_compatible
async def run_dbt_snapshot(
profiles_dir: Optional[Union[Path, str]] = None,
project_dir: Optional[Union[Path, str]] = None,
Expand Down Expand Up @@ -693,6 +697,7 @@ def dbt_test_flow():


@task
@sync_compatible
async def run_dbt_seed(
profiles_dir: Optional[Union[Path, str]] = None,
project_dir: Optional[Union[Path, str]] = None,
Expand Down Expand Up @@ -767,6 +772,7 @@ def dbt_test_flow():


@task
@sync_compatible
async def run_dbt_source_freshness(
profiles_dir: Optional[Union[Path, str]] = None,
project_dir: Optional[Union[Path, str]] = None,
Expand Down
18 changes: 9 additions & 9 deletions src/integrations/prefect-dbt/tests/cli/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def test_append_dirs_to_commands(
async def test_run_dbt_build_creates_artifact(profiles_dir, dbt_cli_profile_bare):
@flow
async def test_flow():
return await run_dbt_build(
return run_dbt_build(
EmilRex marked this conversation as resolved.
Show resolved Hide resolved
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand All @@ -580,7 +580,7 @@ async def test_flow():
async def test_run_dbt_test_creates_artifact(profiles_dir, dbt_cli_profile_bare):
@flow
async def test_flow():
return await run_dbt_test(
return run_dbt_test(
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand All @@ -599,7 +599,7 @@ async def test_flow():
async def test_run_dbt_snapshot_creates_artifact(profiles_dir, dbt_cli_profile_bare):
@flow
async def test_flow():
return await run_dbt_snapshot(
return run_dbt_snapshot(
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand All @@ -618,7 +618,7 @@ async def test_flow():
async def test_run_dbt_seed_creates_artifact(profiles_dir, dbt_cli_profile_bare):
@flow
async def test_flow():
return await run_dbt_seed(
return run_dbt_seed(
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand All @@ -637,7 +637,7 @@ async def test_flow():
async def test_run_dbt_model_creates_artifact(profiles_dir, dbt_cli_profile_bare):
@flow
async def test_flow():
return await run_dbt_model(
return run_dbt_model(
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand All @@ -658,7 +658,7 @@ async def test_run_dbt_source_freshness_creates_artifact(
):
@flow
async def test_flow():
return await run_dbt_source_freshness(
return run_dbt_source_freshness(
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand All @@ -685,7 +685,7 @@ async def test_run_dbt_model_creates_unsuccessful_artifact(
):
@flow
async def test_flow():
return await run_dbt_model(
return run_dbt_model(
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand All @@ -709,7 +709,7 @@ async def test_run_dbt_source_freshness_creates_unsuccessful_artifact(
):
@flow
async def test_flow():
return await run_dbt_source_freshness(
return run_dbt_source_freshness(
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand All @@ -731,7 +731,7 @@ async def test_flow():
async def test_run_dbt_model_throws_error(profiles_dir, dbt_cli_profile_bare):
@flow
async def test_flow():
return await run_dbt_model(
return run_dbt_model(
profiles_dir=profiles_dir,
dbt_cli_profile=dbt_cli_profile_bare,
summary_artifact_key="foo",
Expand Down