status-im / insights-bi

1 stars 0 forks source link

Status-website: unstringify the label in gh_issues endpoint #14

Open apentori opened 2 months ago

apentori commented 2 months ago

What to do

  1. Extract the labels into another psql table with dbt models
  2. Create a relationship between the two tables (gh_issue and gh_issue_label)

We need to add another Hasura API call during the init to create the relationship between table: https://hasura.io/docs/latest/schema/postgres/table-relationships/create/#step-2-create-an-object-relationship

apentori commented 2 months ago

DBT model modification:

Hasura init modification:

apentori commented 2 months ago

There is an issue when trying to automate the relation between the two endpoint.

It appear there is 21561 issues_labels without any related issue in the db. That block to automate the relation between the two endpoint

apentori commented 2 months ago

Unmatching labels with issue fixed by cleaning all the data.

Each airbyte sync remove the primary and secondary key from Hasura db. It doesn't seem to be problematic at first sight, but it will surely become an issue later.

When checking the sync, some constraint might be syncable: 1715154645_grim

To add constraint in dbt: https://docs.getdbt.com/reference/resource-properties/constraints

Going to check if it's possible to specify the schema of only some table

apentori commented 2 months ago

Constrains are not available in our current dbt version ....

Unfortunately, this feature is not available in dbt Core version 1.4

The relation between object seems to work even if Airbyte remove the postgres constraint.

apentori commented 1 month ago

In order to keep constraint on data, i had to add a dbt transformation on the hasura database: status-website

Modification implied

But why ?