-
-
Notifications
You must be signed in to change notification settings - Fork 57
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(job-runner): enable snuba jobs command to run from JSON manifest #6320
Conversation
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
5253427
to
b6a2ccc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, left a few nits.
snuba/cli/jobs.py
Outdated
params = {} | ||
for pair in pairs: | ||
k, v = pair.split("=") | ||
kwargs[k] = v | ||
params[k] = v | ||
return params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We can use dict comprehension here. Something like this:
return {k: v for k, v in (pair.split("=") for pair in pairs)}
snuba/manual_jobs/job_loader.py
Outdated
if job_type_class is None: | ||
raise Exception( | ||
f"Job does not exist. Did you make a file {class_name}.py yet?" | ||
f"Job does not exist. Did you make a file {job_spec.job_type}.py yet?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to create a custom exception instead of the base Exception
?
snuba/manual_jobs/toy_job.py
Outdated
import click | ||
|
||
from snuba.manual_jobs import Job | ||
from snuba.cli import logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Not a big deal at this point but do you think we should have a separate logger for manual_jobs
? The second answer to this question might be something we want to have, or we can follow the pattern from other modules.
b6a2ccc
to
09b3d13
Compare
https://getsentry.atlassian.net/browse/SNS-2872
#6288