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

chore: upgrade fern #901

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

chore: upgrade fern #901

wants to merge 5 commits into from

Conversation

maxdeichmann
Copy link
Member

No description provided.

@maxdeichmann maxdeichmann marked this pull request as ready for review September 2, 2024 19:43
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Disclaimer: Experimental PR review

PR Summary

This pull request upgrades the Fern-generated code in the langfuse-python repository, focusing on improving compatibility with both Pydantic v1 and v2 while enhancing overall functionality and type safety.

  • Introduced AsyncFernLangfuse and FernLangfuse classes in client.py, providing both synchronous and asynchronous interfaces for the Langfuse API
  • Added new serialization module (serialization.py) for handling type annotations and field metadata, improving type handling across the SDK
  • Implemented a new query encoding mechanism in query_encoder.py to flatten and encode complex query structures for API requests
  • Significantly refactored http_client.py to include robust error handling, retry logic, and support for additional request options
  • Updated multiple resource type files (e.g., base_score.py, dataset.py) to use UniversalBaseModel, ensuring compatibility with both Pydantic versions

30 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings

Comment on lines +14 to +18
input: typing.Optional[typing.Optional[typing.Any]] = None
expected_output: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(
alias="expectedOutput", default=None
)
metadata: typing.Optional[typing.Any] = None
source_trace_id: typing.Optional[str] = pydantic_v1.Field(
metadata: typing.Optional[typing.Optional[typing.Any]] = None
Copy link

Choose a reason for hiding this comment

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

logic: Double Optional wrapping for 'input', 'expected_output', and 'metadata' fields. This might be unintentional and could lead to unexpected behavior.

return active()
if self is DatasetStatus.ARCHIVED:
return archived()
DatasetStatus = typing.Union[typing.Literal["ACTIVE", "ARCHIVED"], typing.Any]
Copy link

Choose a reason for hiding this comment

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

logic: Removal of visit method may break existing code that relies on it.

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.

1 participant