Skip to content

Commit

Permalink
deletes old cloud cli (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas committed Aug 29, 2023
1 parent fbfcbb6 commit 8e51830
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 1,584 deletions.
2 changes: 0 additions & 2 deletions src/ploomber/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from ploomber.cli import (
cloud,
build,
plot,
task,
Expand All @@ -12,7 +11,6 @@
)

__all__ = [
"cloud",
"task",
"plot",
"build",
Expand Down
59 changes: 0 additions & 59 deletions src/ploomber/cli/cloud.py

This file was deleted.

17 changes: 1 addition & 16 deletions src/ploomber/cli/task.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from ploomber.cli.parsers import CustomParser
from ploomber.cli.io import cli_endpoint
from ploomber.telemetry import telemetry
from ploomber.cloud.api import PloomberCloudAPI
from ploomber.tasks import NotebookRunner, PythonCallable
from ploomber.executors import _format
from ploomber.messagecollector import task_build_exception
Expand All @@ -14,7 +13,7 @@
ONLY_IN_CALLABLES_AND_NBS = "Only supported in function and notebook tasks."


def _task_cli(accept_task_id=False):
def _task_cli():
parser = CustomParser(description="Build tasks", prog="ploomber task")

with parser:
Expand Down Expand Up @@ -59,9 +58,6 @@ def _task_cli(accept_task_id=False):
action="store_true",
)

if accept_task_id:
parser.add_argument("--task-id")

dag, args = parser.load_from_entry_point_arg()

dag.render()
Expand Down Expand Up @@ -101,9 +97,6 @@ def _task_cli(accept_task_id=False):
err = e

if err is not None:
if getattr(args, "task_id", None):
PloomberCloudAPI().tasks_update(getattr(args, "task_id"), "failed")

msg = _format.exception(err)
exception_string = task_build_exception(
task=task, message=msg, exception=err
Expand All @@ -114,16 +107,8 @@ def _task_cli(accept_task_id=False):
click.echo(f"{task.name!r} task executed successfully!")
click.echo("Products:\n" + repr(task.product))

if getattr(args, "task_id", None):
PloomberCloudAPI().tasks_update(getattr(args, "task_id"), "finished")


@cli_endpoint
@telemetry.log_call("task")
def main():
_task_cli()


# TODO: test this
if __name__ == "__main__":
_task_cli(accept_task_id=True)
15 changes: 0 additions & 15 deletions src/ploomber/cloud/__init__.py

This file was deleted.

22 changes: 0 additions & 22 deletions src/ploomber/cloud/__main__.py

This file was deleted.

Loading

0 comments on commit 8e51830

Please sign in to comment.