Skip to content

Fix additional Ruff issues#383

Merged
brianhelba merged 8 commits intomainfrom
ruff-fixes
Feb 27, 2026
Merged

Fix additional Ruff issues#383
brianhelba merged 8 commits intomainfrom
ruff-fixes

Conversation

@brianhelba
Copy link
Member

No description provided.

@brianhelba brianhelba requested a review from naglepuff February 25, 2026 16:18
brianhelba and others added 8 commits February 27, 2026 00:08
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- guano_utils: add .replace(tzinfo=UTC) for consistency with DTZ001 fix
- recording views: use date.fromisoformat() and time() constructor
  instead of strptime, since the model fields are DateField/TimeField

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses raw FK IDs (e.g. self.recording_id) instead of FK objects
to avoid triggering database queries in string representations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use `pk` for top-level resource IDs, `annotation_pk` for nested
Annotations IDs, `sequence_annotation_pk` for nested SequenceAnnotations
IDs, and `recording_pk` for nested Recording IDs in Django Ninja view
functions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace f-strings with lazy % formatting in all logger.info,
logger.warning, and logger.error calls to defer string interpolation
until the message is actually emitted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The spectrogram/compressed_spectrogram properties on Recording and
NABatRecording used assert to guard against empty querysets before
indexing [0]. Replace with .latest("created") which returns the most
recent object directly and raises DoesNotExist if none exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
No call sites pass extra keyword arguments to these methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@brianhelba brianhelba merged commit dec6f7b into main Feb 27, 2026
6 checks passed
@brianhelba brianhelba deleted the ruff-fixes branch February 27, 2026 18:02
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.

2 participants