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

db2: Fix exception during temp table lookup #910

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

detule
Copy link
Collaborator

@detule detule commented Apr 5, 2025

Self explanatory.

@detule detule requested a review from simonpcouch April 5, 2025 17:26
@detule
Copy link
Collaborator Author

detule commented Apr 5, 2025

Closes #905

Copy link
Collaborator

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this happen! May also be worth a NEWS entry.

@@ -68,7 +68,9 @@ setMethod("odbcConnectionTables", c("DB2/AIX64", "character"),
tryCatch({
dfTempTables <- dbGetQuery(conn, query)
# NULL as colname is not well liked by DB2 it seems. Hack here.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# NULL as colname is not well liked by DB2 it seems. Hack here.
# NULL as colname is not well liked by DB2 it seems. Hack here. (#905).

This will provide a clickable link in RStudio/Positron, making for easier navigation to the relevant GitHub archaelogy.

@@ -68,7 +68,9 @@ setMethod("odbcConnectionTables", c("DB2/AIX64", "character"),
tryCatch({
dfTempTables <- dbGetQuery(conn, query)
# NULL as colname is not well liked by DB2 it seems. Hack here.
dfTempTables$table_remarks <- NA_character_
if (nrow(dfTempTables)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (nrow(dfTempTables)) {
if (nrow(dfTempTables) > 0) {

I admit that we don't apply this consistently throughout the repo, but I tend to prefer not leaning on the "positive number evaluates to TRUE" in if statements" trick, and this seems to be the norm in the tidyverse.

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.

2 participants