44
44
)
45
45
from prefect .cli .root import app , is_interactive
46
46
from prefect .client .base import ServerType
47
+ from prefect .client .orchestration import get_client
47
48
from prefect .client .schemas .actions import DeploymentScheduleCreate
48
49
from prefect .client .schemas .filters import WorkerFilter
49
50
from prefect .client .schemas .objects import ConcurrencyLimitConfig
52
53
IntervalSchedule ,
53
54
RRuleSchedule ,
54
55
)
55
- from prefect .client .utilities import inject_client
56
56
from prefect .deployments import initialize_project
57
57
from prefect .deployments .base import (
58
58
_format_deployment_for_saving_to_prefect_file ,
@@ -477,14 +477,14 @@ async def deploy(
477
477
exit_with_error (str (exc ))
478
478
479
479
480
- @inject_client
481
480
async def _run_single_deploy (
482
481
deploy_config : dict [str , Any ],
483
482
actions : dict [str , Any ],
484
483
options : dict [str , Any ] | None = None ,
485
484
client : Optional ["PrefectClient" ] = None ,
486
485
prefect_file : Path = Path ("prefect.yaml" ),
487
486
):
487
+ client = client or get_client ()
488
488
deploy_config = deepcopy (deploy_config ) if deploy_config else {}
489
489
actions = deepcopy (actions ) if actions else {}
490
490
options = deepcopy (options ) if options else {}
@@ -919,10 +919,8 @@ def _construct_schedules(
919
919
Returns:
920
920
A list of schedule objects
921
921
"""
922
- schedules = []
923
- schedule_configs : list [dict [str , Any ]] | NotSet = (
924
- deploy_config .get ("schedules" , []) or []
925
- )
922
+ schedules : list [DeploymentScheduleCreate ] = [] # Initialize with empty list
923
+ schedule_configs = deploy_config .get ("schedules" , NotSet ) or []
926
924
927
925
if schedule_configs is not NotSet :
928
926
schedules = [
@@ -932,8 +930,6 @@ def _construct_schedules(
932
930
elif schedule_configs is NotSet :
933
931
if is_interactive ():
934
932
schedules = prompt_schedules (app .console )
935
- else :
936
- schedules = []
937
933
938
934
return schedules
939
935
0 commit comments