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

enable full info() on vector-via-sql #615

Merged
merged 2 commits into from
Feb 21, 2025
Merged

enable full info() on vector-via-sql #615

merged 2 commits into from
Feb 21, 2025

Conversation

mdsumner
Copy link
Collaborator

Implementation of #614

Copy link
Collaborator

@ctoney ctoney left a comment

Choose a reason for hiding this comment

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

Thanks! Let me know your preference on the possible edit and then I'll merge.

R/gdalvector.R Outdated
#' prints the DSN and SQL.
#' `cl_arg = c("-so", "-nomd")`, and for layers open with a SQL statement,
#' calls [ogrinfo()] passing the command options
#' `cl_arg = c("-so", "-nomd", "-sql", <layer>)`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Really minor I know, but instead of ... "-sql", <layer>)I'm thinking it should say ... "-sql", <statement>), since that would match the ogrinfo command-line documentation at https://gdal.org/en/stable/programs/ogrinfo.html#ogrinfo (and you pass R_NilValue for the layer and m_layer_name in this case actually contains the sql statement).

Acknowledge it's not exactly clean relative to the GDALVector constructor where we only have layer which can be layer name or SQL statement, but since these are ogrinfo cl options I sort of think it should match to that. Your call, feel free to keep it the way it is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

great catch, I didn't think to look at ogrinfo

@@ -1079,7 +1079,7 @@ test_that("info() prints output to the console", {
lyr$close()

lyr <- new(GDALVector, dsn, "SELECT * FROM mtbs_perims LIMIT 10")
expect_output(lyr$info())
expect_output(lyr$info(), "Feature Count: 10")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes me realize I have several expect_output that are missing some specific text to check for! Will fix at some point.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was very happy to see that expect_output was as sophisticated as it is ;)

@mdsumner
Copy link
Collaborator Author

Thanks! Let me know your preference on the possible edit and then I'll merge.

I'll include the edit as I've been working with that already.

@ctoney ctoney merged commit 97fbd8f into main Feb 21, 2025
8 checks passed
ctoney added a commit that referenced this pull request Feb 21, 2025
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