MCPcopy Create free account
hub / github.com/apache/datafusion / validate_argument_order

Function validate_argument_order

datafusion/expr/src/arguments.rs:87–103  ·  view source on GitHub ↗

Validates that positional arguments come before named arguments

(arg_names: &[Option<ArgumentName>])

Source from the content-addressed store, hash-verified

85
86/// Validates that positional arguments come before named arguments
87fn validate_argument_order(arg_names: &[Option<ArgumentName>]) -> Result<()> {
88 let mut seen_named = false;
89 for (i, arg_name) in arg_names.iter().enumerate() {
90 match arg_name {
91 Some(_) => seen_named = true,
92 None if seen_named => {
93 return plan_err!(
94 "Positional argument at position {} follows named argument. \
95 All positional arguments must come before named arguments.",
96 i
97 );
98 }
99 None => {}
100 }
101 }
102 Ok(())
103}
104
105/// Reorders arguments based on named parameters to match signature order
106fn reorder_named_arguments(

Callers 1

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…