Skip to content

Commit bd10f27

Browse files
authored
minor: run all examples by default (#19506)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## Rationale for this change A small fix-up to run ```sh cargo run --example relation_planner ``` instead of ```sh cargo run --example relation_planner -- all ``` If no arguments are specified, run all examples. It conforms to the expected behaviour of cargo examples. Extracted from to #19311 (comment) ## What changes are included in this PR? ## Are these changes tested? Manual tests. ## Are there any user-facing changes? No
1 parent d7e5190 commit bd10f27

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed

datafusion-examples/examples/builtin_functions/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async fn main() -> Result<()> {
8080

8181
let example: ExampleKind = std::env::args()
8282
.nth(1)
83-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
83+
.unwrap_or_else(|| ExampleKind::All.to_string())
8484
.parse()
8585
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
8686

datafusion-examples/examples/custom_data_source/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async fn main() -> Result<()> {
108108

109109
let example: ExampleKind = std::env::args()
110110
.nth(1)
111-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
111+
.unwrap_or_else(|| ExampleKind::All.to_string())
112112
.parse()
113113
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
114114

datafusion-examples/examples/data_io/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ async fn main() -> Result<()> {
116116

117117
let example: ExampleKind = std::env::args()
118118
.nth(1)
119-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
119+
.unwrap_or_else(|| ExampleKind::All.to_string())
120120
.parse()
121121
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
122122

datafusion-examples/examples/dataframe/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async fn main() -> Result<()> {
8585

8686
let example: ExampleKind = std::env::args()
8787
.nth(1)
88-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
88+
.unwrap_or_else(|| ExampleKind::All.to_string())
8989
.parse()
9090
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
9191

datafusion-examples/examples/execution_monitoring/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async fn main() -> Result<()> {
8484

8585
let example: ExampleKind = std::env::args()
8686
.nth(1)
87-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
87+
.unwrap_or_else(|| ExampleKind::All.to_string())
8888
.parse()
8989
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
9090

datafusion-examples/examples/external_dependency/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async fn main() -> Result<()> {
7676

7777
let example: ExampleKind = std::env::args()
7878
.nth(1)
79-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
79+
.unwrap_or_else(|| ExampleKind::All.to_string())
8080
.parse()
8181
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
8282

datafusion-examples/examples/flight/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
8787

8888
let example: ExampleKind = std::env::args()
8989
.nth(1)
90-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
90+
.unwrap_or_else(|| ExampleKind::All.to_string())
9191
.parse()
9292
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
9393

datafusion-examples/examples/proto/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async fn main() -> Result<()> {
7474

7575
let example: ExampleKind = std::env::args()
7676
.nth(1)
77-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
77+
.unwrap_or_else(|| ExampleKind::All.to_string())
7878
.parse()
7979
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
8080

datafusion-examples/examples/query_planning/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async fn main() -> Result<()> {
100100

101101
let example: ExampleKind = std::env::args()
102102
.nth(1)
103-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
103+
.unwrap_or_else(|| ExampleKind::All.to_string())
104104
.parse()
105105
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
106106

datafusion-examples/examples/relation_planner/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async fn main() -> Result<()> {
9090

9191
let example: ExampleKind = std::env::args()
9292
.nth(1)
93-
.ok_or_else(|| DataFusionError::Execution(format!("Missing argument. {usage}")))?
93+
.unwrap_or_else(|| ExampleKind::All.to_string())
9494
.parse()
9595
.map_err(|_| DataFusionError::Execution(format!("Unknown example. {usage}")))?;
9696

0 commit comments

Comments
 (0)