Skip to content

Commit e7e1a1d

Browse files
authored
Fix a clippy warning in datafusion-sqllogictest (#14506)
1 parent 2ad28e0 commit e7e1a1d

File tree

1 file changed

+4
-10
lines changed
  • datafusion/sqllogictest/src/engines/postgres_engine

1 file changed

+4
-10
lines changed

datafusion/sqllogictest/src/engines/postgres_engine/mod.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
use async_trait::async_trait;
1919
use bytes::Bytes;
20+
use datafusion_common_runtime::SpawnedTask;
2021
use futures::{SinkExt, StreamExt};
2122
use log::{debug, info};
2223
use sqllogictest::DBOutput;
2324
/// Postgres engine implementation for sqllogictest.
2425
use std::path::{Path, PathBuf};
2526
use std::str::FromStr;
2627
use std::time::Duration;
27-
use tokio::task::JoinHandle;
2828

2929
use super::conversion::*;
3030
use crate::engines::output::{DFColumnType, DFOutput};
@@ -54,7 +54,7 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
5454

5555
pub struct Postgres {
5656
client: tokio_postgres::Client,
57-
join_handle: JoinHandle<()>,
57+
_spawned_task: SpawnedTask<()>,
5858
/// Relative test file path
5959
relative_path: PathBuf,
6060
pb: ProgressBar,
@@ -90,7 +90,7 @@ impl Postgres {
9090

9191
let (client, connection) = res?;
9292

93-
let join_handle = tokio::spawn(async move {
93+
let _spawned_task = SpawnedTask::spawn(async move {
9494
if let Err(e) = connection.await {
9595
log::error!("Postgres connection error: {:?}", e);
9696
}
@@ -114,7 +114,7 @@ impl Postgres {
114114

115115
Ok(Self {
116116
client,
117-
join_handle,
117+
_spawned_task,
118118
relative_path,
119119
pb,
120120
})
@@ -222,12 +222,6 @@ fn schema_name(relative_path: &Path) -> String {
222222
.to_string()
223223
}
224224

225-
impl Drop for Postgres {
226-
fn drop(&mut self) {
227-
self.join_handle.abort()
228-
}
229-
}
230-
231225
#[async_trait]
232226
impl sqllogictest::AsyncDB for Postgres {
233227
type Error = Error;

0 commit comments

Comments
 (0)