Skip to content

Scary .unwrap_or(MoneyPerFlow(0.0)) #1359

Description

@tsmbland

There's an .unwrap_or(MoneyPerFlow(0.0)) statement in get_revenue_from_flows_with_filter that I feel uneasy about every time I come across.

I don't think it's reasonable to broadly assume that if a price is missing then the price is zero. Not saying there's a bug here, as we probably are only doing this for commodities that are genuinely unpriced (e.g. OTH commodities), but I still think we should design this whole part of the code in a more intentional way, as otherwise it's easy to imagine a bug creeping in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions