Skip to content

case_sparql_select: Add flags to disable headers and row index numbers #92

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

Merged
merged 2 commits into from
Dec 8, 2022

Conversation

ajnelson-nist
Copy link
Member

This patch series adds and tests --no-header and --no-index for case_sparql_select. The flags disable output for some use cases that do not benefit from the annotations. For instance:

  • Generated query results in Git-tracked output change all rows following any result additions in the middle, due to the row number incrementing. --no-index instead lets each insertion be noted as an added line without other side-effect.
  • When a single column is generated as a CSV or TSV, it is possible the user will have enough knowledge of that "Flat file's" purpose that the header is unnecessary, and possibly a nuisance to downstream consumption. --no-header removes the header without post-processing.

This should be merged after #90 is merged, as it is built on the patch in 90.

There are non-trivial effects on this patch series from #91, so if #91 is merged first, this patch series should catch up with develop.

This patch is code-motion to give function names to chunks of
`case_sparql_select:main`.

Some upcoming patch series are going to add features that, when taken
together, introduce non-trivial parameter-value cross-dependencies.

Moving functionality to functions enables combinatoric testing in a
`pytest` space, rather than resorting to copying, pasting, and tweaking
many Makefile lines.  A future patch series will add the `pytest`
script.

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
The test pattern for these features encourages an enumerative approach,
so a `pytest` script exercising the freshly broken-out functions is now
included.

No effects were observed on Make-managed files.

Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
@ajnelson-nist ajnelson-nist added this to the 0.9.0 milestone Dec 7, 2022
@ajnelson-nist ajnelson-nist marked this pull request as ready for review December 8, 2022 13:53
@kchason kchason merged commit c76ace0 into develop Dec 8, 2022
@ajnelson-nist ajnelson-nist deleted the case_sparql_select_add_header_and_index_flags branch April 28, 2023 20:30
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