Skip to content

Conversation

@JosephCatrambone
Copy link
Contributor

Backstory in #1091

We don't want people to try to import and run the command that defines the COMMAND LINE INTERFACE FOR INSTALL guardrails hub install instead of the actual install command. If someone searches the code and doesn't pay attention they might (rather, they have) do from guardrails.cli.hub.install import install instead of from guardrails.hub import install. The former will report that a guard is not found when invoked with a string because it breaks it into characters and attempts to install all of them individually.

We resolve this in two ways:
First, make the install CLI function named install_cli so people don't import it by mistake. (Keep the invocation as guardrails hub install)

Second, check if the parameter passed is a string instead of a list and add a warning for string passage.

…eep the invocation as guardrails hub install) so people don't import it by mistake. Add warning for string passage.
@JosephCatrambone JosephCatrambone marked this pull request as ready for review September 25, 2024 18:23
@JosephCatrambone JosephCatrambone marked this pull request as draft September 25, 2024 18:35
@JosephCatrambone JosephCatrambone marked this pull request as ready for review September 25, 2024 18:55
@JosephCatrambone JosephCatrambone merged commit 9b7cfc3 into main Sep 25, 2024
12 checks passed
@JosephCatrambone JosephCatrambone deleted the jc/bugfix_footgun_hub_cli_install branch September 25, 2024 21:11
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.

3 participants