Skip to content

Minor: remove unnecessary dependencies in datafusion-sqllogictest #14578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions datafusion/sqllogictest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ bytes = { workspace = true, optional = true }
chrono = { workspace = true, optional = true }
clap = { version = "4.5.16", features = ["derive", "env"] }
datafusion = { workspace = true, default-features = true, features = ["avro"] }
datafusion-catalog = { workspace = true, default-features = true }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of this PR is to remove these three lines

datafusion-common = { workspace = true, default-features = true }
datafusion-common-runtime = { workspace = true, default-features = true }
futures = { workspace = true }
half = { workspace = true, default-features = true }
indicatif = "0.17"
Expand Down
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/bin/postgres_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// under the License.

use crate::Options;
use datafusion_common::Result;
use datafusion::common::Result;
use log::info;
use std::env::set_var;
use std::future::Future;
Expand Down
12 changes: 6 additions & 6 deletions datafusion/sqllogictest/bin/sqllogictests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
// under the License.

use clap::Parser;
use datafusion_common::instant::Instant;
use datafusion_common::utils::get_available_parallelism;
use datafusion_common::{exec_err, DataFusionError, Result};
use datafusion_common_runtime::SpawnedTask;
use datafusion::common::instant::Instant;
use datafusion::common::utils::get_available_parallelism;
use datafusion::common::{exec_err, DataFusionError, Result};
use datafusion_sqllogictest::{
df_value_validator, read_dir_recursive, setup_scratch_dir, value_normalizer,
DataFusion, TestContext,
Expand All @@ -40,6 +39,7 @@ use sqllogictest::{
use crate::postgres_container::{
initialize_postgres_container, terminate_postgres_container,
};
use datafusion::common::runtime::SpawnedTask;
use std::ffi::OsStr;
use std::path::{Path, PathBuf};

Expand Down Expand Up @@ -330,7 +330,7 @@ async fn run_test_file_with_postgres(
_mp: MultiProgress,
_mp_style: ProgressStyle,
) -> Result<()> {
use datafusion_common::plan_err;
use datafusion::common::plan_err;
plan_err!("Can not run with postgres as postgres feature is not enabled")
}

Expand Down Expand Up @@ -446,7 +446,7 @@ async fn run_complete_file_with_postgres(
_mp: MultiProgress,
_mp_style: ProgressStyle,
) -> Result<()> {
use datafusion_common::plan_err;
use datafusion::common::plan_err;
plan_err!("Can not run with postgres as postgres feature is not enabled")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// under the License.

use arrow::error::ArrowError;
use datafusion_common::DataFusionError;
use datafusion::error::DataFusionError;
use sqllogictest::TestError;
use sqlparser::parser::ParserError;
use thiserror::Error;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@
// specific language governing permissions and limitations
// under the License.

use super::super::conversion::*;
use super::error::{DFSqlLogicTestError, Result};
use crate::engines::output::DFColumnType;
use arrow::array::{Array, AsArray};
use arrow::datatypes::Fields;
use arrow::util::display::ArrayFormatter;
use arrow::{array, array::ArrayRef, datatypes::DataType, record_batch::RecordBatch};
use datafusion_common::format::DEFAULT_CLI_FORMAT_OPTIONS;
use datafusion_common::DataFusionError;
use datafusion::common::format::DEFAULT_CLI_FORMAT_OPTIONS;
use datafusion::common::DataFusionError;
use std::path::PathBuf;
use std::sync::LazyLock;

use super::super::conversion::*;
use super::error::{DFSqlLogicTestError, Result};

/// Converts `batches` to a result as expected by sqllogictest.
pub fn convert_batches(batches: Vec<RecordBatch>) -> Result<Vec<Vec<String>>> {
if batches.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/src/engines/postgres_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use async_trait::async_trait;
use bytes::Bytes;
use datafusion_common_runtime::SpawnedTask;
use datafusion::common::runtime::SpawnedTask;
use futures::{SinkExt, StreamExt};
use log::{debug, info};
use sqllogictest::DBOutput;
Expand Down
12 changes: 6 additions & 6 deletions datafusion/sqllogictest/src/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ use arrow::array::{
};
use arrow::datatypes::{DataType, Field, Schema, SchemaRef, TimeUnit};
use arrow::record_batch::RecordBatch;
use datafusion::catalog::{
CatalogProvider, MemoryCatalogProvider, MemorySchemaProvider, Session,
};
use datafusion::common::DataFusionError;
use datafusion::logical_expr::{create_udf, ColumnarValue, Expr, ScalarUDF, Volatility};
use datafusion::physical_plan::ExecutionPlan;
use datafusion::prelude::SessionConfig;
use datafusion::prelude::*;
use datafusion::{
datasource::{MemTable, TableProvider, TableType},
prelude::{CsvReadOptions, SessionContext},
};
use datafusion_catalog::CatalogProvider;
use datafusion_catalog::{memory::MemoryCatalogProvider, memory::MemorySchemaProvider};
use datafusion_common::cast::as_float64_array;
use datafusion_common::DataFusionError;

use async_trait::async_trait;
use datafusion::catalog::Session;
use datafusion::common::cast::as_float64_array;
use log::info;
use tempfile::TempDir;

Expand Down
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

use datafusion_common::{exec_datafusion_err, Result};
use datafusion::common::{exec_datafusion_err, Result};
use itertools::Itertools;
use log::Level::Warn;
use log::{info, log_enabled, warn};
Expand Down