docs: improve type hints and documentation in Python SDK#1126
Open
hiSandog wants to merge 3 commits intolangflow-ai:mainfrom
Open
docs: improve type hints and documentation in Python SDK#1126hiSandog wants to merge 3 commits intolangflow-ai:mainfrom
hiSandog wants to merge 3 commits intolangflow-ai:mainfrom
Conversation
- Add comprehensive JSDoc-style docstrings to all functions - Add new utilities: get_env_bool, get_env_str, get_env_list, get_env_dict - Add require_env function for mandatory environment variables - Add safe_bool function with support for common truthy/falsy values - Add type annotations to settings.py configuration variables - Organize settings.py with section comments for better readability - Export utilities from utils/__init__.py for easier imports - Improve error messages with descriptive information
- Add module docstrings to client.py and models.py - Add proper type annotations for __aexit__ method - Improve IngestTaskStatus docstring and use Field for files dict - Add from __future__ import annotations for forward references
…ility - Enhanced error detection for OpenSearch 3.0 KNN field bug - Added specific error message when KNNMethodConfigContext error occurs - Provided helpful workaround suggestion in error response - Improved logging for KNN compatibility issues - Changed TODO comment to informative note about the limitation This helps users understand and work around the OpenSearch 3.0 bug with document-level monitors on indexes containing KNN fields.
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.
Summary
This PR improves the Python SDK with better type hints and documentation:
Changes
client.py:
__aexit__method parametersfrom __future__ import annotationsfor forward referencesmodels.py:
IngestTaskStatusclass with detailed attribute docstringsfiles: dicttofiles: dict[str, Any] = Field(default_factory=dict)for better type safetyBenefits