Skip to content

Commit

Permalink
Add escapes for otherwise problematic dataset / table names. (#8162)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcovarr authored Jan 13, 2023
1 parent fedb320 commit 8a7b95d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/variantstore/wdl/GvsExtractCallset.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,16 @@ task GenerateSampleListFile {
String bq_labels = "--label service:gvs --label team:variants --label managedby:extract_callset"

command <<<
set -e
# Prepend date, time and pwd to xtrace log entries.
PS4='\D{+%F %T} \w $ '
set -o errexit -o nounset -o pipefail -o xtrace

# Drop trailing slash if one exists
OUTPUT_GCS_DIR=$(echo ~{output_gcs_dir} | sed 's/\/$//')

echo "project_id = ~{query_project}" > ~/.bigqueryrc

bq --project_id=~{query_project} --format=csv query --use_legacy_sql=false ~{bq_labels} "SELECT sample_name FROM ~{fq_samples_to_extract_table}" | sed 1d > sample-name-list.txt
bq --project_id=~{query_project} --format=csv query --use_legacy_sql=false ~{bq_labels} 'SELECT sample_name FROM `~{fq_samples_to_extract_table}`' | sed 1d > sample-name-list.txt

if [ -n "$OUTPUT_GCS_DIR" ]; then
gsutil cp sample-name-list.txt ${OUTPUT_GCS_DIR}/
Expand Down

0 comments on commit 8a7b95d

Please sign in to comment.