docs: document public SDK APIs#581
Merged
Merged
Conversation
Member
Author
|
1st of many PRs documenting all public APIs and configurations so your favorite agent will have a better hint before using outdated docs or making wrong assumptions, well if your agent was heavily depending on that ofc. |
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
posthog/ai/otel/exporter.py:74-80
The `force_flush` docstring is missing a `Returns:` section, making it inconsistent with the `export` method directly above it which documents its return value. The method signature declares `-> bool`, so the return value should be described.
```suggestion
def force_flush(self, timeout_millis: Optional[int] = None) -> bool:
"""
Flush pending spans from the underlying OTLP exporter.
Args:
timeout_millis: Optional flush timeout in milliseconds.
Returns:
True if the flush succeeded within the timeout, False otherwise.
"""
```
### Issue 2 of 2
posthog/ai/otel/processor.py:79-85
Same missing `Returns:` section as in `exporter.py` — the `force_flush` method returns `bool` but the docstring does not document the return value.
```suggestion
def force_flush(self, timeout_millis: Optional[int] = None) -> bool:
"""
Flush pending spans from the underlying batch span processor.
Args:
timeout_millis: Optional flush timeout in milliseconds.
Returns:
True if the flush succeeded within the timeout, False otherwise.
"""
```
Reviews (1): Last reviewed commit: "docs: document public SDK APIs" | Re-trigger Greptile |
5 tasks
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.
💡 Motivation and Context
Public SDK APIs should be discoverable from source docstrings as well as the published docs. Several customer-facing methods and configuration options were undocumented or only partially documented in code.
This updates docstrings for public SDK methods/configuration that are documented in the official Python SDK docs or exposed as customer-facing APIs, while leaving internal/private helpers alone.
💚 How did you test it?
python3 -m compileall -q posthog📝 Checklist
If releasing new changes
sampo addto generate a changeset file