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

Method validate_short_alias

benchmarks/src/benchmark_runner/suite.rs:310–330  ·  view source on GitHub ↗

Validates the optional short alias for one suite-defined option.

(&self)

Source from the content-addressed store, hash-verified

308
309 /// Validates the optional short alias for one suite-defined option.
310 fn validate_short_alias(&self) -> Result<()> {
311 let Some(short) = &self.short else {
312 return Ok(());
313 };
314
315 if short.trim().is_empty() {
316 return Err(DataFusionError::Configuration(format!(
317 "short alias for option '{}' cannot be empty",
318 self.name
319 )));
320 }
321
322 if !is_valid_cli_option_name(short) {
323 return Err(DataFusionError::Configuration(format!(
324 "invalid short alias '{short}' for option '{}'; expected lowercase ASCII letters, digits, and hyphens",
325 self.name
326 )));
327 }
328
329 Ok(())
330 }
331}
332
333impl SuiteRegistry {

Callers 1

validateMethod · 0.80

Calls 3

is_valid_cli_option_nameFunction · 0.85
trimMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected