Skip to content

Commit

Permalink
#1112 don't try to set os.environ['PGPASSWORD']
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielwol committed Dec 19, 2024
1 parent f7f0fdc commit 8645bdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dags/pull_here.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def load_data_run(download_url)->str:
conn = BaseHook.get_connection("here_bot")
os.environ['HOST'] = conn.host
os.environ['LOGIN'] = conn.login
os.environ['PGPASSWORD'] = conn.password
os.environ['PW'] = conn.password
os.environ['DOWNLOAD_URL'] = download_url
return '''curl $DOWNLOAD_URL | gunzip | psql -h $HOST -U $LOGIN -d bigdata -c "\\COPY here.ta_view FROM STDIN WITH (FORMAT csv, HEADER TRUE);" '''
return '''curl $DOWNLOAD_URL | gunzip | PGPASSWORD=$PW psql -h $HOST -U $LOGIN -d bigdata -c "\\COPY here.ta_view FROM STDIN WITH (FORMAT csv, HEADER TRUE);" '''

# Create a task group for triggering the DAGs
@task_group(group_id='trigger_dags_tasks')
Expand Down
4 changes: 2 additions & 2 deletions dags/pull_here_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def load_data(download_url)->str:
conn = BaseHook.get_connection("here_bot")
os.environ['HOST'] = conn.host
os.environ['LOGIN'] = conn.login
os.environ['PGPASSWORD'] = conn.password
os.environ['PW'] = conn.password
os.environ['DOWNLOAD_URL'] = download_url
return '''curl $DOWNLOAD_URL | gunzip | psql -h $HOST -U $LOGIN -d bigdata -c "\\COPY here.ta_path_view FROM STDIN WITH (FORMAT csv, HEADER TRUE);" '''
return '''curl $DOWNLOAD_URL | gunzip | PGPASSWORD=$PW psql -h $HOST -U $LOGIN -d bigdata -c "\\COPY here.ta_path_view FROM STDIN WITH (FORMAT csv, HEADER TRUE);" '''

load_data(download_url)

Expand Down

0 comments on commit 8645bdb

Please sign in to comment.