Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jun 24, 2025

Important

Handle AttributeError in auth_check() in client.py by logging a warning and returning False if the client is not properly initialized.

  • Behavior:
    • In auth_check() in client.py, handle AttributeError by logging a warning and returning False if the client is not properly initialized.
  • Logging:
    • Add warning log for AttributeError in auth_check() to indicate improper client initialization.

This description was created by Ellipsis for f8bf543. You can customize this summary. It will automatically update as commits are pushed.

Greptile Summary

Disclaimer: Experimental PR review

Enhanced error handling in auth_check() method to prevent crashes when credentials are missing or invalid, improving client initialization robustness.

  • Added AttributeError handling in langfuse/_client/client.py to gracefully handle cases where self.api is not accessible
  • Returns False and logs warning when authentication fails due to missing credentials
  • Maintains compatibility with existing auth_check() boolean return contract

Copy link
Contributor

@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.

LGTM

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp enabled auto-merge (squash) June 26, 2025 11:48
@hassiebp hassiebp merged commit 875d2f2 into main Jun 26, 2025
10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-5468 branch June 26, 2025 17:23
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.

bug: AttributeError: 'Langfuse' object has no attribute 'api' when calling auth_check when there is no auth.

2 participants