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

Destinations #290

Merged
merged 3 commits into from
Nov 14, 2024
Merged

Destinations #290

merged 3 commits into from
Nov 14, 2024

Conversation

jquagga
Copy link
Owner

@jquagga jquagga commented Nov 14, 2024

Summary by Sourcery

Optimize GPU memory usage by conditionally importing torch only when using transformers and add error handling in the send_notifications function to handle missing destinations.

Enhancements:

  • Optimize GPU memory usage by conditionally importing torch only when using transformers.

Chores:

  • Add error handling in send_notifications function to handle missing destinations.

Copy link
Contributor

sourcery-ai bot commented Nov 14, 2024

Reviewer's Guide by Sourcery

This PR improves error handling in the notification system and adds clarifying comments about the transcription service selection. The main changes involve wrapping the notification sending logic in a try-except block to gracefully handle missing destinations and adding documentation about the dependency requirements for different transcription services.

Sequence diagram for sending notifications with error handling

sequenceDiagram
    participant User
    participant System
    participant Apprise
    User->>System: Trigger send_notifications
    System->>System: Check destinations
    alt Destination exists
        System->>Apprise: Add notify_url
        opt Attach audio
            System->>Apprise: audio_notification
        end
        System->>Apprise: apobj.notify
    else Destination missing
        System->>User: Print error message
    end
Loading

File-Level Changes

Change Details Files
Added error handling for notification destinations
  • Wrapped notification sending logic in a try-except block
  • Added error message for missing destinations in destination.csv
  • Added sourcery skip comment for bare except usage
ttt.py
Added documentation for transcription service selection
  • Added comments explaining the conditional loading of torch based on transcription service choice
  • Clarified the available transcription service options (Deepgram, Whisper, or transformers)
ttt.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jquagga jquagga enabled auto-merge (squash) November 14, 2024 12:46
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @jquagga - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider catching specific exceptions (e.g. KeyError) instead of using a bare except clause to avoid masking unexpected errors
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jquagga jquagga merged commit aade1e3 into main Nov 14, 2024
5 checks passed
@jquagga jquagga deleted the destinations branch December 5, 2024 21:21
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