-
Notifications
You must be signed in to change notification settings - Fork 235
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
Remove src_postgres #2881
Remove src_postgres #2881
Conversation
replaced src_postgres() calls with DBI calls.
Did you update the changelog?--
David
…--
David LeBauer
Director of Data Sciences
CALS Comm and Technologies
THE UNIVERSITY OF ARIZONA
BSRL, 207
1230 N Cherry Ave | Tucson, AZ 85721
Office: 520-621-4381 | Cell: 760-468-8621
***@***.***
datascience.cals.arizona.edu
orcid | twitter | github | linkedin
|
|
dbname='bety', driver='PostgreSQL',write=TRUE) | ||
con <- PEcAn.DB::db.open(bety) | ||
bety$con <- con | ||
con <- PEcAn.DB::db.open( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there isn't much to be done with these hardcoded ones (regarding the port I mean)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, these need to be addressed sometime but this refactor was sprawling far enough as it is :p
Co-authored-by: istfer <[email protected]>
Co-authored-by: istfer <[email protected]>
@robkooper Can you squash-merge this, please? The commits contain a lot of back and forth that doesn't need to be preserved. |
done |
This is a continuation of PR #2785, which we can no longer update because of an accidentally deleted source branch that turned out to be more hassle to fix than seemed worth it. All the commits from #2785 are contained here and all comments from that discussion thread are now resolved.
Description
dplyr::src_postgres
, mostly by replacing withPEcAn.DB::db.open()
but sometimes withDBI::dbConnect()
in places that are run without the PEcAn packages available. Fixes src_postgres needs to be deprecated everywhere #2688bety <- db.open(...); con <- bety$con
tocon <- db.open(...)
bety$con
to justbety
(orcon
, in cases wherebety
was renamed in previous step)DBI::dbConnect(...)
calls toPEcAn.DB::db.open(...)
, except in contexts where PEcAn.DB may not be available (e.g. pecanapi demo) or to access non-PEcAn databases (e.g. some examples in DB package)settings$database$bety
intodb.open()
rather than pick out individual components. Attn @istfer: I believe this should allow port specification to work consistently as requested in src_postgres needs to be deprecated everywhere #2688 (comment)Motivation and Context
dplyr::src_postgres()
is now deprecated and the advice is to instead directly pass a DBI connection intodplyr::tbl()
. We've previously replaced a few of these piecemeal, but not systematically (as evidenced by all the places the code was handling both barecon
andbety$con
).Review Time Estimate
Types of changes
Checklist: