Skip to content

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

@gogonzo

Description

@gogonzo

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
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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions