Skip to content

Commit

Permalink
Do not write empty csv instanceid file when sql query returns zero rows
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreben committed May 10, 2024
1 parent cbbd96b commit 813cd58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libsys_airflow/plugins/data_exports/instance_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ def save_ids(**kwargs) -> str:
filestamp = kwargs.get("timestamp", datetime.now().strftime('%Y%m%d%H%M'))
airflow = kwargs.get("airflow", "/opt/airflow")
vendor = kwargs.get("vendor")
data = kwargs.get("data", "")
data = kwargs.get("data")
kind = kwargs.get("kind")

if not data:
return

data_path = (
Path(airflow) / f"data-export-files/{vendor}/instanceids/{kind}/{filestamp}.csv"
)
Expand Down

0 comments on commit 813cd58

Please sign in to comment.