Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Chen authored and Rachel Chen committed Sep 17, 2024
1 parent d2df47d commit 4c906c0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions snuba/cli/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from snuba.manual_jobs import JobSpec
from snuba.manual_jobs.job_loader import JobLoader
from snuba.manual_jobs.manifest_reader import ManifestReader
from snuba.manual_jobs.manifest_reader import _ManifestReader

JOB_SPECIFICATION_ERROR_MSG = "Missing job type and/or job id"

Expand All @@ -14,14 +14,6 @@ def jobs() -> None:
pass


def _parse_params(pairs: Tuple[str, ...]) -> MutableMapping[Any, Any]:
params = {}
for pair in pairs:
k, v = pair.split("=")
params[k] = v
return params


@jobs.command()
@click.option("--json_manifest", required=True)
@click.option("--job_id")
Expand All @@ -30,14 +22,22 @@ def _parse_params(pairs: Tuple[str, ...]) -> MutableMapping[Any, Any]:
default=True,
)
def run_from_manifest(*, json_manifest: str, job_id: str, dry_run: bool) -> None:
job_specs = ManifestReader.read(json_manifest)
job_specs = _ManifestReader.read(json_manifest)
if job_id not in job_specs.keys():
raise click.ClickException("Provide a valid job id")

job_to_run = JobLoader.get_job_instance(job_specs[job_id], dry_run)
job_to_run.execute()


def _parse_params(pairs: Tuple[str, ...]) -> MutableMapping[Any, Any]:
params = {}
for pair in pairs:
k, v = pair.split("=")
params[k] = v
return params


@jobs.command()
@click.option("--job_type")
@click.option("--job_id")
Expand Down

0 comments on commit 4c906c0

Please sign in to comment.