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

Handle Postgres connection when running in Cloud Run #38

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

stdavis
Copy link
Member

@stdavis stdavis commented Jan 12, 2023

This was all working great on my local machine but failed to connect to the database when I pushed it as a cloud function. This PR branches the engine creation method based on the runtime environment.

Ref: https://cloud.google.com/sql/docs/postgres/connect-functions

@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Base: 91.56% // Head: 91.18% // Decreases project coverage by -0.38% ⚠️

Coverage data is based on head (4006ea9) compared to base (302ac9b).
Patch coverage: 57.14% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
- Coverage   91.56%   91.18%   -0.39%     
==========================================
  Files           6        6              
  Lines         688      692       +4     
  Branches       91       92       +1     
==========================================
+ Hits          630      631       +1     
- Misses         52       54       +2     
- Partials        6        7       +1     
Impacted Files Coverage Δ
src/palletjack/loaders.py 87.62% <57.14%> (-1.27%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jacobdadams jacobdadams merged commit f46d993 into main Jan 12, 2023
@jacobdadams jacobdadams deleted the fix/postgres-connection branch January 12, 2023 21:09
@jacobdadams
Copy link
Member

@stdavis, the new version has been uploaded to pypi.

jacobdadams added a commit that referenced this pull request Jan 12, 2023
@steveoh
Copy link
Member

steveoh commented Jan 12, 2023

@jacobdadams I wrote this for sweeper if you want to crib it to automate publishing to pypi. https://github.com/agrc/sweeper/blob/main/.github/workflows/python.yml

jacobdadams added a commit that referenced this pull request Jan 31, 2023
jacobdadams added a commit that referenced this pull request Mar 7, 2023
jacobdadams added a commit that referenced this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants