Skip to content

Commit 190e166

Browse files
authored
Revert "Add cli option to update workflow" (#99)
1 parent 607222e commit 190e166

6 files changed

Lines changed: 3 additions & 74 deletions

File tree

flytekit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import absolute_import
22
import flytekit.plugins
33

4-
__version__ = '0.6.1'
4+
__version__ = '0.6.2'

flytekit/clients/friendly.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,12 @@ def list_workflows_paginated(
303303

304304
def get_workflow(self, id):
305305
"""
306-
This returns a single workflow for a given ID.
306+
This returns a single task for a given ID.
307307
308308
:param flytekit.models.core.identifier.Identifier id: The ID representing a given task.
309309
:raises: TODO
310310
:rtype: flytekit.models.admin.workflow.Workflow
311311
"""
312-
313312
return _workflow.Workflow.from_flyte_idl(
314313
super(SynchronousFlyteClient, self).get_workflow(
315314
_common_pb2.ObjectGetRequest(
@@ -318,25 +317,6 @@ def get_workflow(self, id):
318317
)
319318
)
320319

321-
def update_workflow(self, id, state):
322-
"""
323-
This updates the state of the workflow specified by the ID.
324-
:param id: flytekit.models.core.identifier.Identifier id: The ID representing a given task.
325-
:param int state: Enum value from flytekit.models.workflow.WorkflowState
326-
:return:
327-
"""
328-
if state == "active":
329-
state = _workflow.WorkflowState.ACTIVE
330-
else:
331-
state = _workflow.WorkflowState.ARCHIVED
332-
super(SynchronousFlyteClient, self).update_workflow(
333-
_workflow_pb2.WorkflowUpdateRequest(
334-
id=id.to_flyte_idl(),
335-
state=state,
336-
)
337-
)
338-
339-
340320
####################################################################################################################
341321
#
342322
# Launch Plan Endpoints

flytekit/clients/raw.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,6 @@ def create_workflow(self, workflow_create_request):
250250
"""
251251
return self._stub.CreateWorkflow(workflow_create_request, metadata=self._metadata)
252252

253-
@_handle_rpc_error
254-
def update_workflow(self, update_request):
255-
"""
256-
Allows updates to a workflow for a given identifier. Currently, only the workflow state can updated for
257-
ACTIVE and ARCHIVED values.
258-
:param flyteidl.admin.workflow_pb2.WorkflowUpdateRequest update_request:
259-
:rtype: flyteidl.admin.workflow_pb2.WorkflowPlanUpdateResponse
260-
"""
261-
return self._stub.UpdateWorkflow(update_request, metadata=self._metadata)
262-
263253
@_handle_rpc_error
264254
def list_workflow_ids_paginated(self, identifier_list_request):
265255
"""

flytekit/clis/flyte_cli/main.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,6 @@ def _render_schedule_expr(lp):
403403
required=True,
404404
help="Whether or not to set schedule as active."
405405
)
406-
_workflow_state_choice = _click.option(
407-
"--state",
408-
type=_click.Choice(["active", "archived"]),
409-
required=True,
410-
help="Whether or not to set a workflow as visible in the UI."
411-
)
412406
_sort_by_option = _click.option(
413407
"--sort-by",
414408
required=False,
@@ -780,23 +774,6 @@ def get_workflow(urn, host, insecure):
780774
_click.echo("")
781775

782776

783-
@_flyte_cli.command('update-workflow', cls=_FlyteSubCommand)
784-
@_workflow_state_choice
785-
@_urn_option
786-
@_host_option
787-
@_insecure_option
788-
def update_workflow(state, urn, host, insecure):
789-
"""
790-
Update the state of a certain version of a workflow identified by the URN in the form of
791-
``wf:<project>:<domain>:<workflow_name>:<version>``
792-
"""
793-
_welcome_message()
794-
client = _friendly_client.SynchronousFlyteClient(host, insecure=insecure)
795-
client.update_workflow(_identifier.Identifier.from_python_std(urn), state)
796-
_click.echo("Successfully updated {}".format(_tt(urn)))
797-
798-
799-
800777
########################################################################################################################
801778
#
802779
# Launch Plan Commands

flytekit/models/admin/workflow.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,3 @@ def from_flyte_idl(cls, p):
129129
return cls(
130130
compiled_workflow=_compiler_models.CompiledWorkflowClosure.from_flyte_idl(p.compiled_workflow)
131131
)
132-
133-
134-
class WorkflowState(object):
135-
ACTIVE = _admin_workflow.WORKFLOW_ACTIVE
136-
ARCHIVED = _admin_workflow.WORKFLOW_ARCHIVED
137-
138-
@classmethod
139-
def enum_to_string(cls, val):
140-
"""
141-
:param int val:
142-
:rtype: Text
143-
"""
144-
if val == cls.ACTIVE:
145-
return "WORKFLOW_ACTIVE"
146-
elif val == cls.ARCHIVED:
147-
return "WORKFLOW_ARCHIVED"
148-
else:
149-
return "<UNKNOWN>"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
]
3030
},
3131
install_requires=[
32-
"flyteidl>=0.17.25,<1.0.0",
32+
"flyteidl>=0.17.27,<1.0.0",
3333
"click>=6.6,<8.0",
3434
"croniter>=0.3.20,<4.0.0",
3535
"deprecation>=2.0,<3.0",

0 commit comments

Comments
 (0)