Skip to content
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

Fix bool flag in prepare #7529

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/variantstore/wdl/GvsPrepareCallset.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ workflow GvsPrepareCallset {
String fq_destination_dataset = "~{destination_project}.~{destination_dataset}"

Int temp_table_ttl_in_hours = 72
Boolean skip_pet_insert = false
Boolean skip_vet_new_insert = false
String? service_account_json_path
String? docker
}
Expand All @@ -37,7 +37,7 @@ workflow GvsPrepareCallset {
fq_temp_table_dataset = fq_temp_table_dataset,
fq_destination_dataset = fq_destination_dataset,
temp_table_ttl_in_hours = temp_table_ttl_in_hours,
skip_pet_insert = skip_pet_insert,
skip_vet_new_insert = skip_vet_new_insert,
service_account_json_path = service_account_json_path,
docker = docker_final
}
Expand Down Expand Up @@ -65,7 +65,7 @@ task PrepareCallsetTask {
String fq_temp_table_dataset
String fq_destination_dataset
Int temp_table_ttl_in_hours
Boolean skip_pet_insert
Boolean skip_vet_new_insert

String? service_account_json_path
String docker
Expand Down Expand Up @@ -107,7 +107,7 @@ task PrepareCallsetTask {
~{sep=" " query_label_args} \
--fq_sample_mapping_table ~{fq_sample_mapping_table} \
--ttl ~{temp_table_ttl_in_hours} \
--skip_pet_insert ~{skip_pet_insert} \
--skip_vet_new_insert ~{skip_vet_new_insert} \
$SERVICE_ACCOUNT_STANZA
>>>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def create_final_extract_table(fq_destination_table_data):
print(sql)
results = utils.execute_with_retry(client, "create-final-export-table", sql)

def populate_final_extract_table_with_vet_new(fq_temp_table_dataset, fq_destination_table_data, skip_pet_insert):
def populate_final_extract_table_with_vet_new(fq_temp_table_dataset, fq_destination_table_data, skip_vet_new_insert):
sql = f"""
INSERT INTO `{fq_destination_table_data}`
SELECT
Expand All @@ -247,7 +247,7 @@ def populate_final_extract_table_with_vet_new(fq_temp_table_dataset, fq_destinat
`{fq_temp_table_dataset}.{VET_NEW_TABLE}`
"""
print(sql)
if (not skip_pet_insert):
if (not skip_vet_new_insert):
results = utils.execute_with_retry(client, "populate-final-export-vet", sql)
print(f"\nFinal cohort extract data written to {fq_destination_table_data}\n")
else:
Expand All @@ -268,7 +268,7 @@ def make_extract_table(fq_pet_vet_dataset,
fq_sample_mapping_table,
sa_key_path,
temp_table_ttl_hours,
skip_pet_insert
skip_vet_new_insert
):
try:
fq_destination_table_data = f"{fq_destination_dataset}.{destination_table_prefix}__DATA"
Expand Down Expand Up @@ -340,7 +340,7 @@ def make_extract_table(fq_pet_vet_dataset,
create_position_table(fq_temp_table_dataset, min_variant_samples)
create_final_extract_table(fq_destination_table_data)
populate_final_extract_table_with_pet(fq_pet_vet_dataset, fq_temp_table_dataset, fq_destination_table_data, sample_ids)
populate_final_extract_table_with_vet_new(fq_temp_table_dataset, fq_destination_table_data, skip_pet_insert)
populate_final_extract_table_with_vet_new(fq_temp_table_dataset, fq_destination_table_data, skip_vet_new_insert)
finally:
dump_job_stats()

Expand All @@ -358,9 +358,9 @@ def make_extract_table(fq_pet_vet_dataset,
parser.add_argument('--sa_key_path',type=str, help='Path to json key file for SA', required=False)
parser.add_argument('--max_tables',type=int, help='Maximum number of PET/VET tables to consider', required=False, default=250)
parser.add_argument('--ttl',type=int, help='Temp table TTL in hours', required=False, default=72)
parser.add_argument('--skip_pet_insert',type=bool,
parser.add_argument('--skip_vet_new_insert', default=False, type=lambda x: (str(x).lower() == 'true'),
help='This will not execute the final sql query to insert the pet_new data into the DATA table, but will print out the command instead. Useful when flex slots need to be allocated.',
required=False, default=False)
required=False)
sample_args = parser.add_mutually_exclusive_group(required=True)
sample_args.add_argument('--sample_names_to_extract',type=str, help='File containing list of samples to extract, 1 per line')
sample_args.add_argument('--fq_cohort_sample_names',type=str, help='FQN of cohort table to extract, contains "sample_name" column')
Expand All @@ -382,4 +382,4 @@ def make_extract_table(fq_pet_vet_dataset,
args.fq_sample_mapping_table,
args.sa_key_path,
args.ttl,
args.skip_pet_insert)
args.skip_vet_new_insert)