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

Feat!: Remove deprecated project_dir argument #453

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions projects/orquestra-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

* Setting `workspace_id` is now required when submitting workflow to remote clusters
* `TaskDef` `WorkflowDef` and `TaskInvocation` Objects `__init__` functions now do set parameters by default.
* Removed deprecated `project_dir` argument from all workflow-related functions

🔥 *Features*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import warnings
from datetime import timedelta
from functools import cached_property
from pathlib import Path
from urllib.parse import urlparse

from orquestra.workflow_shared import ProjectRef, iter_invocations_topologically, serde
Expand Down Expand Up @@ -72,7 +71,6 @@ def by_id(
cls,
run_id: str,
config: t.Optional[t.Union["RuntimeConfig", str]] = None,
project_dir: t.Optional[t.Union[Path, str]] = None,
) -> "WorkflowRun":
"""Get the WorkflowRun corresponding to a previous workflow run.

Expand All @@ -81,7 +79,6 @@ def by_id(
config: Determines where to look for the workflow run record. If omitted,
we will retrieve the config name from a local cache of workflow runs
submitted from this machine.
project_dir: DEPRECATED

Raises:
orquestra.sdk.exceptions.RuntimeQuerySummaryError: when ``config``
Expand All @@ -97,12 +94,6 @@ def by_id(
orquestra.sdk.exceptions.ConfigNameNotFoundError: when there's no
corresponding config entry in the config file.
"""
if project_dir:
warnings.warn(
"project_dir argument is deprecated and will be removed"
"in upcoming versions of orquestra-sdk"
)

# Resolve config
resolved_config: RuntimeConfig
if config is None:
Expand Down Expand Up @@ -147,7 +138,6 @@ def start_from_ir(
workspace_id: t.Optional[WorkspaceId] = None,
project_id: t.Optional[ProjectId] = None,
dry_run: bool = False,
project_dir: t.Optional[t.Union[str, Path]] = None,
):
"""Start workflow run from its IR representation.

Expand All @@ -160,14 +150,7 @@ def start_from_ir(
project_id: ID of the project for workflow - supported only on CE
dry_run: Run the workflow without actually executing any task code.
Useful for testing infrastructure, dependency imports, etc.
project_dir: DEPRECATED
"""
if project_dir:
warnings.warn(
"project_dir argument is deprecated and will be removed"
"in upcoming versions of orquestra-sdk"
)

_config = resolve_config(config)

runtime = _config._get_runtime()
Expand Down Expand Up @@ -747,7 +730,6 @@ def list_workflow_runs(
limit: t.Optional[int] = None,
max_age: t.Optional[str] = None,
state: t.Optional[t.Union[State, t.List[State]]] = None,
project_dir: t.Optional[t.Union[Path, str]] = None,
workspace: t.Optional[WorkspaceId] = None,
project: t.Optional[ProjectId] = None,
) -> t.List[WorkflowRun]:
Expand All @@ -764,7 +746,6 @@ def list_workflow_runs(
limit: Restrict the number of runs to return, prioritising the most recent.
max_age: Only return runs younger than the specified maximum age.
state: Only return runs of runs with the specified status.
project_dir: DEPRECATED
workspace: Only return runs from the specified workspace when using CE.
project: will be used to list workflows from specific workspace and project
when using CE.
Expand All @@ -778,13 +759,6 @@ def list_workflow_runs(
a list of WorkflowRuns
"""
# TODO: update docstring when platform workspace/project filtering is merged [ORQP-1479](https://zapatacomputing.atlassian.net/browse/ORQP-1479?atlOrigin=eyJpIjoiZWExMWI4MDUzYTI0NDQ0ZDg2ZTBlNzgyNjE3Njc4MDgiLCJwIjoiaiJ9) # noqa: E501

if project_dir:
warnings.warn(
"project_dir argument is deprecated and will be removed"
"in upcoming versions of orquestra-sdk"
)

_handle_common_listing_project_errors(project, workspace)
workspace = resolve_studio_workspace_ref(workspace_id=workspace)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import functools
import inspect
import warnings
from pathlib import Path
from types import FunctionType
from typing import (
Any,
Expand Down Expand Up @@ -154,7 +153,6 @@ def graph(self):
def run(
self,
config: Union[RuntimeConfig, str],
project_dir: Optional[Union[str, Path]] = None,
workspace_id: Optional[WorkspaceId] = None,
project_id: Optional[ProjectId] = None,
dry_run: bool = False,
Expand All @@ -165,7 +163,6 @@ def run(
config: SDK needs to know where to execute the workflow. The config
contains the required details. This can be a RuntimeConfig object, or
the name of a saved configuration.
project_dir: DEPRECATED
workspace_id: ID of the workspace for workflow - supported only on CE
project_id: ID of the project for workflow - supported only on CE
dry_run: Run the workflow without actually executing any task code.
Expand All @@ -178,12 +175,6 @@ def run(
orquestra.sdk.exceptions.ProjectInvalidError: when only 1 out of project and
workspace is passed.
"""
if project_dir:
warnings.warn(
"project_dir argument is deprecated and will be removed"
"in upcoming versions of orquestra-sdk"
)

try:
wf_def_model = self.model
except exceptions.DirtyGitRepo:
Expand Down
Loading