Fix APIClient docstring: correct version parameter default value#3375
Open
scottlawsonbc wants to merge 1 commit intodocker:mainfrom
Open
Fix APIClient docstring: correct version parameter default value#3375scottlawsonbc wants to merge 1 commit intodocker:mainfrom
scottlawsonbc wants to merge 1 commit intodocker:mainfrom
Conversation
The docstring incorrectly stated that the default value for the `version` parameter is `'1.35'`. In reality, the default is `None`, which triggers automatic API version detection (same behavior as `'auto'`). This commit updates the docstring to accurately reflect: - The default value is `None`, not `'1.35'` - Both `None` and `'auto'` trigger automatic version detection - The parameter type should be `str or None` to reflect the actual default Fixes incorrect documentation that could mislead users about the API client's default behavior. Signed-off-by: Scott Lawson <scottlawsonbc@gmail.com>
scottlawsonbc
commented
Dec 17, 2025
| ``unix:///var/run/docker.sock`` or ``tcp://127.0.0.1:1234``. | ||
| version (str): The version of the API to use. Set to ``auto`` to | ||
| automatically detect the server's version. Default: ``1.35`` | ||
| version (str or None): The version of the API to use. If ``None`` |
Author
There was a problem hiding this comment.
see line 204 below to confirm the logic for "version" matches this docstring.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The docstring for APIClient incorrectly stated that the default value for the
versionparameter is'1.35'. In reality, the default isNone, which triggers automatic API version detection (same behavior as'auto').This commit updates the docstring to accurately reflect:
None, not'1.35'Noneand'auto'trigger automatic version detectionstr or Noneto reflect the actual defaultFixes incorrect documentation that could mislead users about the API client's default behavior.
This PR was motivated from having encountered this issue personally following the docker v29 changes. I don't want others to fall into the same trap.