Skip to content

Commit

Permalink
reduce args for graph cli
Browse files Browse the repository at this point in the history
  • Loading branch information
prism-admin committed Mar 25, 2024
1 parent b686c43 commit 967de3b
Showing 1 changed file with 29 additions and 35 deletions.
64 changes: 29 additions & 35 deletions prism/main.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import json
import sys
from pathlib import Path
from typing import Any, Dict, Iterable, Literal, Optional

import rich
import rich_click as click
from typing import Any, Dict, Literal, Optional, Iterable

# Prism imports
import prism.constants
import prism.exceptions
from prism.client.client import PrismProject
from prism.cli.init import initialize_project
import prism.logging.loggers

from prism.cli.init import initialize_project
from prism.client.client import PrismProject

# Use markdown for --help
click.rich_click.USE_MARKDOWN = True
Expand Down Expand Up @@ -194,9 +194,9 @@ def run(
<br>Examples:
- prism run
- prism run -t task01.py -t task02.py
- prism run -t task01 --all-downstream
- prism run --context '{"hi": 1}'
- prism run -t task01.Task01 -t task02.Task02
- prism run -t task01.Task01 --all-downstream
- prism run --runtime-ctx '{"hi": 1}'
"""
project_dir = Path.cwd()
try:
Expand Down Expand Up @@ -253,20 +253,20 @@ def run(
help="Project version.",
multiple=False,
)
@click.option(
"--connector",
type=str,
help="""Import path to the connector instances to use for your project. These can be
accessed at runtime `CurrentRun.conn(...)`.""",
multiple=True,
)
@click.option(
"--concurrency",
type=int,
help="""Number of threads to use when running tasks. Default is `1` (i.e.,
single-threaded)""",
default=1,
)
# @click.option(
# "--connector",
# type=str,
# help="""Import path to the connector instances to use for your project. These can be
# accessed at runtime `CurrentRun.conn(...)`.""",
# multiple=True,
# )
# @click.option(
# "--concurrency",
# type=int,
# help="""Number of threads to use when running tasks. Default is `1` (i.e.,
# single-threaded)""",
# default=1,
# )
@click.option(
"--tasks-dir",
type=str,
Expand All @@ -276,14 +276,14 @@ def run(
default=Path.cwd() / "tasks",
required=True,
)
@click.option(
"--package-lookups",
type=str,
help="""Additional directories / modules to look within when importing modules and
functions in your code. The `tasks_dir` and its parent are automatically
added to this list.""",
multiple=True,
)
# @click.option(
# "--package-lookups",
# type=str,
# help="""Additional directories / modules to look within when importing modules and
# functions in your code. The `tasks_dir` and its parent are automatically
# added to this list.""",
# multiple=True,
# )
@click.option(
"--port",
"-p",
Expand Down Expand Up @@ -316,10 +316,7 @@ def graph(
project_id: Optional[str],
project_name: Optional[str],
project_version: Optional[str],
connector: Iterable[str],
concurrency: int,
tasks_dir: str,
package_lookups: Iterable[str],
port: int,
open_window: bool,
hot_reload: bool,
Expand All @@ -334,10 +331,7 @@ def graph(
id=project_id if project_id else f"{project_dir.name.lower()}-{version}",
name=project_name if project_name else f"{project_dir.name.lower()}",
version=version,
connectors=list(connector),
concurrency=concurrency,
tasks_dir=tasks_dir,
package_lookups=list(package_lookups),
)
prism_project.graph(
port=port,
Expand Down

0 comments on commit 967de3b

Please sign in to comment.