opensource-observer / oso

Measuring the impact of open source software
https://opensource.observer
Apache License 2.0
73 stars 16 forks source link

Standardizing Currency Data from Open Collective #2195

Open Jabolol opened 1 month ago

Jabolol commented 1 month ago

What is it?

Open Collective currently returns currency data in local currencies without a standardized parameter. This conflicts with the universal event table's definition, where the amount field assumes a consistent currency.

After discussing with the team, potential solutions include: collecting only USD transactions for consistency, maintaining a daily table of currency exchange rates in BigQuery as a source of truth, or introducing an additional API to handle conversions.

Edit: For now, we will filter out all non USD transactions

ryscheng commented 1 month ago

I think that's fine for now. The nature of dbt makes it very easy to change this in the future.

FWIW, in the timeseries_metrics marts, we introduce a unit column for this reason, because there are different unit measures for different metrics. https://github.com/opensource-observer/oso/blob/main/warehouse/metrics_mesh/models/timeseries_metrics_by_project_v0.sql

It wouldn't hurt to introduce a nullable unit column in the event table to capture this kind of information.