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

Validate conditionally-required arguments at startup #82

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

daverigby
Copy link
Collaborator

Problem

Different databases require different arguments - for example:

pinecone requires that --pinecone_api_key and --pinecone_index_name are specified.

Currently this is not validated as part of parsing the command-line
options, and will only be detected later on when we attempt to
initialise the given database, which isn't necessarily clear to the
user.

Solution

Improve this by adding explicit checking that such
conditionally-required arguments are indeed specified, printing out a
relevent error message if any are omitted.

Fixes #77.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Test Plan

Added test which verifies we check for the optional args correctly.

Different databases require different arguments - for example:

    pinecone requires that --pinecone_api_key and --pinecone_index_name are specified.

Currently this is not validated as part of parsing the command-line
options, and will only be detected later on when we attempt to
initialise the given database, which isn't necessarily clear to the
user.

Improve this by adding explicit checking that such
conditionally-required arguments are indeed specified, printing out a
relevent error message if any are omitted.

Also improve the general format and layout of options help; listing
--workload and --database (the two most important arguments) in their
own group.
@daverigby daverigby force-pushed the conditionally_required branch from a649fb2 to 0b1b9f2 Compare June 5, 2024 09:42
@daverigby daverigby merged commit 23604b5 into main Jun 5, 2024
4 checks passed
@daverigby daverigby deleted the conditionally_required branch June 5, 2024 10:44
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.

Check that required arguments for a given database are specified
1 participant