Skip to content

Apache DataFusion SQL Query Engine

Make `test_display_pg_json` pass regardless of build setup and dependencies (#21502)

Adam Gutglick8a650f5ad62e
diff --git a/Cargo.lock b/Cargo.lock
index 512fbd3c67..ca2554e99d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2660,6 +2660,7 @@ dependencies = [
"object_store",
"postgres-types",
"regex",
+ "serde_json",
"sqllogictest",
"sqlparser",
"tempfile",
diff --git a/datafusion/expr/Cargo.toml b/datafusion/expr/Cargo.toml
index 265651cfe0..8cec01feb3 100644
--- a/datafusion/expr/Cargo.toml
+++ b/datafusion/expr/Cargo.toml
@@ -66,3 +66,6 @@ sqlparser = { workspace = true, optional = true }
ctor = { workspace = true }
env_logger = { workspace = true }
insta = { workspace = true }
+# Makes sure `test_display_pg_json` behaves in a consistent way regardless of
+# feature unification with dependencies
+serde_json = { workspace = true, features = ["preserve_order"] }
diff --git a/datafusion/sqllogictest/Cargo.toml b/datafusion/sqllogictest/Cargo.toml
index d7bb2583c9..1159b7f3b7 100644
--- a/datafusion/sqllogictest/Cargo.toml
+++ b/datafusion/sqllogictest/Cargo.toml
@@ -84,9 +84,17 @@ substrait = ["datafusion-substrait"]
[dev-dependencies]
env_logger = { workspace = true }
regex = { workspace = true }
+# Required to make sure tests for pg display behaves consistently
+# regardless of feature unification with dependencies
+serde_json = { workspace = true, features = ["preserve_order"] }
tokio = { workspace = true, features = ["rt-multi-thread"] }
[[test]]
harness = false
name = "sqllogictests"
path = "bin/sqllogictests.rs"
+
+# Required because we pull serde_json with a feature to get consistent pg display,
+# but its not directly used.
+[package.metadata.cargo-machete]
+ignored = "serde_json"