insightsengineering / insightsengineering/teal.data

[Bug]: Can't find join_keys between indirectly linked datasets

Open
#384 0 comments 0 reactions 1 assignee Claimed by @gogonzo View on GitHub
bug core
Dominant language
R
Stars
11
Forks
9
PR merge metrics
No merged PRs in 30d

Description

### What happened?

`join_keys` with correct parent-child relationships are not easy to design, especially by the inexperienced developer. Indirectly linked datasets need to have the same parent. IMO this is to strict given that their implicit relationships are "indirect" anyway. Here is an example

Image

```r
jk <- join_keys(
join_key("customers", keys = "id"),
join_key("orders", keys = c("id")),
join_key("products", keys = c("id")),
join_key("product_components", keys = c("id")),
join_key("customers", "orders", keys = c(id = "customer_id")),
join_key("orders", "order_items", keys = c(id = "order_id")),
join_key("order_items", "products", keys = c(product_id = "id")), # no common parent
#join_key("products", "order_items", keys = c(id = "product_id")), # is common parent
join_key("products", "product_components", keys = c(id = "product_id"))
)

jk["order_items", "product_components"]
# NULL
```

I propose this change to make it easier for app developer as I couldn't figure out what is the problem with above join keys setup myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.