Skip to content

Commit

Permalink
fix(cpg_flow_test/,cpg_flow_test/jobs/): fix dependency in first stage
Browse files Browse the repository at this point in the history
  • Loading branch information
violetbrina committed Dec 13, 2024
1 parent 7efab1c commit 9256c68
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
9 changes: 4 additions & 5 deletions cpg_flow_test/jobs/first_n_primes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
from hailtop.batch.job import Job


def first_n_primes(
b: Batch,
input_file_path: str,
output_file_path: str,
) -> list[Job]:
def first_n_primes(b: Batch, input_file_path: str, output_file_path: str, depends_on: Job) -> list[Job]:
title = 'First N Primes'
job = b.new_job(name=title)
id_sum_path = b.read_input(input_file_path)

if depends_on:
job.depends_on(depends_on)

cmd = f"""
is_prime() {{
local num=$1
Expand Down
2 changes: 0 additions & 2 deletions cpg_flow_test/jobs/iterative_digit_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def iterative_digit_sum(
iterative_digit_sum "$concatenated_digits"
}}
# Example usage
# Replace "$1" with your actual input
echo "Input: {sequencing_group.id}\n"
result=$(extract_digits_and_sum {sequencing_group.id})
echo "Result: $result\n"
Expand Down
2 changes: 1 addition & 1 deletion cpg_flow_test/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def queue_jobs(self, sequencing_group: SequencingGroup, inputs: StageInput) -> S

# Generate first N primes
primes_output_path = str(self.expected_outputs(sequencing_group).get('primes', ''))
job_primes = first_n_primes(b, id_sum_output_path, primes_output_path)
job_primes = first_n_primes(b, id_sum_output_path, primes_output_path, depends_on=job_id_sum)

jobs = [job_id_sum, job_primes]

Expand Down

0 comments on commit 9256c68

Please sign in to comment.