Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

@whitdog47
Copy link
Contributor

@whitdog47 whitdog47 commented May 16, 2025

This PR adds default None values to several optional fields in signal and project models to allow missing parameters without validation errors.

@whitdog47 whitdog47 requested review from Copilot and mvilanova May 16, 2025 00:01
@whitdog47 whitdog47 self-assigned this May 16, 2025
@whitdog47 whitdog47 added the bug Something isn't working label May 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds default None values to several optional fields in signal and project models to allow missing parameters without validation errors.

  • Added = None defaults for optional fields (case, external_id, signal, case_priority, case_type, conversation_target, oncall_service, and id)
  • Maintained backward compatibility for creating and reading signal instances and projects

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/dispatch/signal/models.py Set default None on newly optional attributes
src/dispatch/project/models.py Added default None for id in ProjectRead
Comments suppressed due to low confidence (1)

src/dispatch/signal/models.py:392

  • Using a mutable default ([]) can lead to shared state across instances. Consider using a Pydantic Field(default_factory=list) or defaulting to None and initializing in __init__.
entities: list[EntityRead] | None = []

Copy link
Contributor

@mvilanova mvilanova left a comment

Choose a reason for hiding this comment

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

Let's take a harder look at the models in a future PR, as they're not in an ideal state.

@whitdog47 whitdog47 merged commit 83d41b2 into main May 16, 2025
9 checks passed
@whitdog47 whitdog47 deleted the fix/allow-none-for-missing-signal-attributes branch May 16, 2025 17:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants