This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate
CloudRunJob
and VertexAICustomTrainingJob
infrastructur…
…e blocks
- Loading branch information
1 parent
c7be9eb
commit 354cc29
Showing
3 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
from prefect._internal.compatibility.deprecated import PrefectDeprecationWarning | ||
|
||
from prefect_gcp.aiplatform import VertexAICustomTrainingJob | ||
from prefect_gcp.cloud_run import CloudRunJob | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"InfraBlock, expected_message", | ||
[ | ||
( | ||
CloudRunJob, | ||
"prefect_gcp.cloud_run.CloudRunJob has been deprecated." | ||
" It will not be available after Sep 2024." | ||
" Use the Vertex AI worker instead." | ||
" Refer to the upgrade guide for more information", | ||
), | ||
( | ||
VertexAICustomTrainingJob, | ||
"prefect_gcp.aiplaform.VertexAICustomTrainingJob has been deprecated." | ||
" It will not be available after Sep 2024." | ||
" Use the Cloud Run or Cloud Run v2 worker instead." | ||
" Refer to the upgrade guide for more information", | ||
), | ||
], | ||
) | ||
def test_infra_blocks_emit_a_deprecation_warning(InfraBlock, expected_message): | ||
with pytest.warns(PrefectDeprecationWarning, match=expected_message): | ||
InfraBlock() |