oso icon indicating copy to clipboard operation
oso copied to clipboard

project metrics models grouped on irrelevant sources/networks

Open ccerv1 opened this issue 1 year ago • 0 comments

Which area(s) are affected? (leave empty if unsure)

Indexer

To Reproduce

Currently, this query returns onchain metrics for networks like github and NPM:

query TestQuery {
  onchain_metrics_by_project(where: {project_id: {_eq: "XSDgPwFuQVcj57ARcKTGrm2w80KKlqJxaBWF6jZqe7w="}}) {
    project_name,
    network,
    num_contracts,
    total_txns
  }
}

Here is the response:

{
  "data": {
    "onchain_metrics_by_project": [
      {
        "project_name": "Uniswap",
        "network": "GITHUB",
        "num_contracts": 59,
        "total_txns": null
      },
      {
        "project_name": "Uniswap",
        "network": "NPM",
        "num_contracts": 38,
        "total_txns": null
      },
      {
        "project_name": "Uniswap",
        "network": "ARBITRUM",
        "num_contracts": 28,
        "total_txns": 36432885
      },
      {
        "project_name": "Uniswap",
        "network": "OPTIMISM",
        "num_contracts": 38,
        "total_txns": 13366211
      },
      {
        "project_name": "Uniswap",
        "network": "MAINNET",
        "num_contracts": 24,
        "total_txns": null
      }
    ]
  }
}

It should not be returning any nodes for sources that don't emit onchain event data like npm and github.

Describe the Bug

The bug is in the dbt models for onchain_metrics, code_metrics, etc. It should be filtering out irrelevant sources/networks or doing join logic that will prevent data from being fetched from sources where everything is null.

Expected Behavior

Data should only be returned from relevant sources of onchain and code metrics.

ccerv1 avatar Mar 13 '24 13:03 ccerv1