ZhuLinsen/daily_stock_analysis · error · ValueError

validation_error

validation_error

Error message

name is required

What it means

Error "name is required" thrown in ZhuLinsen/daily_stock_analysis.

Source

Thrown at src/services/portfolio_service.py:129

    def __init__(self, repo: Optional[PortfolioRepository] = None):
        self.repo = repo or PortfolioRepository()

    # ------------------------------------------------------------------
    # Account CRUD
    # ------------------------------------------------------------------
    def create_account(
        self,
        *,
        name: str,
        broker: Optional[str],
        market: str,
        base_currency: str,
        owner_id: Optional[str] = None,
    ) -> Dict[str, Any]:
        name_norm = (name or "").strip()
        if not name_norm:
            raise ValueError("name is required")
        market_norm = self._normalize_market(market)
        base_currency_norm = self._normalize_currency(base_currency)
        row = self.repo.create_account(
            name=name_norm,
            broker=(broker or "").strip() or None,
            market=market_norm,
            base_currency=base_currency_norm,
            owner_id=(owner_id or "").strip() or None,
        )
        return self._account_to_dict(row)

    def list_accounts(self, include_inactive: bool = False) -> List[Dict[str, Any]]:
        rows = self.repo.list_accounts(include_inactive=include_inactive)
        return [self._account_to_dict(r) for r in rows]

    def update_account(
        self,
        account_id: int,

View on GitHub (pinned to 5159bd72e8)

Solutions

  1. Provide a non-empty name for the portfolio.
  2. Check the request payload to ensure the name field is set.
  3. Trim whitespace-only names before submitting.

When it happens

Trigger: Thrown at src/services/portfolio_service.py:129 when the library encounters an invalid state.

Common situations: Raised when creating a portfolio without a name; occurs when the create request omits the required name field.


AI-assisted analysis of ZhuLinsen/daily_stock_analysis@5159bd72e8 (2026-08-15). Data as JSON: /api/errors/dbd890026c283a45. Report an issue: GitHub.