Skip to content

Commit 64889c0

Browse files
authored
fix doc and broken api (apache#15602)
1 parent 3fe300c commit 64889c0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

datafusion/common/src/functional_dependencies.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ impl Constraints {
4747
Constraints::new_unverified(vec![])
4848
}
4949

50-
/// Create a new `Constraints` object from the given `constraints`.
51-
/// Users should use the `empty` or `new_from_table_constraints` functions
52-
/// for constructing `Constraints`. This constructor is for internal
50+
/// Create a new [`Constraints`] object from the given `constraints`.
51+
/// Users should use the [`Constraints::empty`] or [`SqlToRel::new_constraint_from_table_constraints`] functions
52+
/// for constructing [`Constraints`]. This constructor is for internal
5353
/// purposes only and does not check whether the argument is valid. The user
54-
/// is responsible for supplying a valid vector of `Constraint` objects.
54+
/// is responsible for supplying a valid vector of [`Constraint`] objects.
55+
///
56+
/// [`SqlToRel::new_constraint_from_table_constraints`]: https://docs.rs/datafusion/latest/datafusion/sql/planner/struct.SqlToRel.html#method.new_constraint_from_table_constraints
5557
pub fn new_unverified(constraints: Vec<Constraint>) -> Self {
5658
Self { inner: constraints }
5759
}

datafusion/sql/src/statement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
15471547
}
15481548

15491549
/// Convert each [TableConstraint] to corresponding [Constraint]
1550-
fn new_constraint_from_table_constraints(
1550+
pub fn new_constraint_from_table_constraints(
15511551
&self,
15521552
constraints: &[TableConstraint],
15531553
df_schema: &DFSchemaRef,

0 commit comments

Comments
 (0)