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

perf(decorator): remove get_caller_module #1074

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jan 14, 2025

Important

Remove get_caller_module_name() and related warning logs from LangfuseDecorator to simplify code.

  • Behavior:
    • Removed get_caller_module_name() method from LangfuseDecorator class.
    • Removed warning logs in get_current_trace_id() and get_current_observation_id() when no trace or observation is found.
  • Code Simplification:
    • Eliminated unnecessary module inspection and exception handling related to caller module identification.

This description was created by Ellipsis for 275e2c3. It will automatically update as commits are pushed.

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

Removed the _get_caller_module_name method and related warning logs from the decorator implementation, simplifying the codebase by eliminating special case handling for OpenAI module warnings.

  • Removed _get_caller_module_name method from /langfuse/decorators/langfuse_decorator.py
  • Eliminated conditional warning messages for missing trace/observation contexts
  • Simplified decorator code by removing OpenAI-specific warning suppression logic
  • Improved performance by removing unnecessary stack inspection for caller module name
  • Reduced code complexity by treating all modules consistently without special cases

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit b4d3ab9 into main Jan 14, 2025
7 of 8 checks passed
@hassiebp hassiebp deleted the fix-remove-caller-module-call branch January 14, 2025 09:38
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.

perf(decorator): update_current_trace is slower than update_current_observation
1 participant