dataframely.require_relationship_one_to_at_least_one#

dataframely.require_relationship_one_to_at_least_one(
lhs: LazyFrame[S] | LazyFrame,
rhs: LazyFrame[T] | LazyFrame,
/,
on: str | list[str],
*,
drop_duplicates: bool = True,
) LazyFrame[source]#

Express a 1:{1,N} mapping between data frames for a collection filter.

Parameters:
  • lhs – The data frame with exactly one occurrence for the set of join columns.

  • rhs – The data frame with at least one occurrence for the set of join columns.

  • on – The columns to join the data frames on.

  • drop_duplicates – If set to True, drops rows in lhs that are not uniquely identified by the join columns specified with on. If set to False, skips uniqueness checks and avoids performance penalties. Use with caution, as this may lead to unexpected results if rows in lhs are not unique in the join columns.

Returns:

A data frame representing the inner join of the two inputs on the specified columns, filtered to ensure a 1:{1,N} relationship.