Skip to content

Commit

Permalink
Move paper_references_merged query to this repository; switch trigger…
Browse files Browse the repository at this point in the history
… from citation percentiles to fos
  • Loading branch information
jmelot committed Apr 23, 2021
1 parent 14f86db commit cba3577
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 15 additions & 1 deletion linkage_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,20 @@
write_disposition="WRITE_TRUNCATE"
))

# this query is essentially just copying mapped_references to paper_references_merged, so
# putting this in the push_to_production array is not risky
push_to_production.append(
BigQueryOperator(
task_id="copy_mapped_references_to_paper_references_merged",
sql=f"select id as merged_id, ref_id from {staging_dataset}.mapped_references",
destination_dataset_table=f"{production_dataset}.paper_references_merged",
allow_large_results=True,
use_legacy_sql=False,
create_disposition="CREATE_IF_NEEDED",
write_disposition="WRITE_TRUNCATE"
)
)

snapshot_table = f"{backup_dataset}.article_links_"+datetime.now().strftime("%Y%m%d")
# mk the snapshot predictions table
snapshot = BigQueryToBigQueryOperator(
Expand All @@ -443,7 +457,7 @@

downstream_tasks = [
TriggerDagRunOperator(task_id="trigger_article_classification", trigger_dag_id="article_classification"),
TriggerDagRunOperator(task_id="trigger_citation_percentiles", trigger_dag_id="citation_percentiles"),
TriggerDagRunOperator(task_id="trigger_fields_of_study", trigger_dag_id="fields_of_study"),
]

# task structure
Expand Down
1 change: 0 additions & 1 deletion push_to_airflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ gsutil cp utils/article_linkage_lid_dataflow_requirements.txt gs://us-east1-etl-
gsutil cp utils/article_linkage_text_clean_requirements.txt gs://us-east1-etl-05d83c6e-bucket/dags/requirements/
gsutil cp utils/clean_corpus.py gs://us-east1-etl-05d83c6e-bucket/dags/linkage_scripts/
gsutil cp utils/run_lid.py gs://us-east1-etl-05d83c6e-bucket/dags/linkage_scripts/

0 comments on commit cba3577

Please sign in to comment.