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

ENH: Optimize error message when user parameters are passed incorrectly #2623

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

namecd
Copy link
Contributor

@namecd namecd commented Dec 3, 2024

issue: # 2539

More information is provided for the situation described in issue (#2539), and a test example is added to ensure that the error parameters of the test message are correct

Problem description:

  1. When a user specifies a parameter but does not specify the parameter value, the error message is not obvious
  2. After investigation, it is found that the problem is the 'click' library of the parsing parameter passed, and the parameter name that indicates the value of the next parameter is taken as the parameter value

Solution:

  • Adds an error message and indicates the location of the parameter passing error

@XprobeBot XprobeBot added the bug Something isn't working label Dec 3, 2024
@XprobeBot XprobeBot added this to the v1.x milestone Dec 3, 2024
@qinxuye
Copy link
Contributor

qinxuye commented Dec 3, 2024

The lint failed, please install pre-commit and do pre-commit install at the project level, then before commit, the code will be formatted automatically, and if flake8 and so forth failed, you will know before pushing to github.

@qinxuye qinxuye changed the title FIX: Added a message when user parameters are passed incorrectly ENH: Added a message when user parameters are passed incorrectly Dec 3, 2024
@XprobeBot XprobeBot added enhancement New feature or request and removed bug Something isn't working labels Dec 3, 2024
@namecd
Copy link
Contributor Author

namecd commented Dec 3, 2024

With pre-commit already passed, except for deploy/cmdline.py and deploy/test/test_error_message.py, which are the main changes, the rest are formatting changes, which are done automatically by black

@qinxuye
Copy link
Contributor

qinxuye commented Dec 3, 2024

Please revert the changes that are irrelevant.

xinference/deploy/test/test_error_message.py Outdated Show resolved Hide resolved
xinference/deploy/test/test_error_message.py Outdated Show resolved Hide resolved
xinference/deploy/test/test_error_message.py Outdated Show resolved Hide resolved
xinference/deploy/test/test_error_message.py Outdated Show resolved Hide resolved
xinference/deploy/test/test_error_message.py Outdated Show resolved Hide resolved
xinference/deploy/test/test_cmdline.py Outdated Show resolved Hide resolved
xinference/deploy/test/test_cmdline.py Outdated Show resolved Hide resolved
xinference/deploy/test/test_cmdline.py Outdated Show resolved Hide resolved
Copy link
Contributor

@qinxuye qinxuye left a comment

Choose a reason for hiding this comment

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

LGTM

@qinxuye qinxuye changed the title ENH: Added a message when user parameters are passed incorrectly ENH: Optimize error message when user parameters are passed incorrectly Dec 6, 2024
@qinxuye qinxuye merged commit 45cedde into xorbitsai:main Dec 6, 2024
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants