Skip to content

Commit 9e8ec54

Browse files
authored
chore: rename Schema print_schema_tree to tree_string (apache#17919)
* chore: rename Schema `print_tree_method` to `tree_string` * Rollback mistaken submodule updates for datafusion-testing and testing
1 parent 71d7415 commit 9e8ec54

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

datafusion/common/src/dfschema.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ impl DFSchema {
876876
.zip(self.inner.fields().iter())
877877
.map(|(qualifier, field)| (qualifier.as_ref(), field))
878878
}
879-
/// Print schema in tree format
879+
/// Returns a tree-like string representation of the schema.
880880
///
881881
/// This method formats the schema
882882
/// with a tree-like structure showing field names, types, and nullability.
@@ -896,12 +896,12 @@ impl DFSchema {
896896
/// HashMap::new()
897897
/// ).unwrap();
898898
///
899-
/// assert_eq!(schema.print_schema_tree().to_string(),
899+
/// assert_eq!(schema.tree_string().to_string(),
900900
/// r#"root
901901
/// |-- id: int32 (nullable = false)
902902
/// |-- name: utf8 (nullable = true)"#);
903903
/// ```
904-
pub fn print_schema_tree(&self) -> impl Display + '_ {
904+
pub fn tree_string(&self) -> impl Display + '_ {
905905
let mut result = String::from("root\n");
906906

907907
for (qualifier, field) in self.iter() {
@@ -1982,7 +1982,7 @@ mod tests {
19821982
)
19831983
.unwrap();
19841984

1985-
let output = schema.print_schema_tree();
1985+
let output = schema.tree_string();
19861986

19871987
insta::assert_snapshot!(output, @r"
19881988
root
@@ -2004,7 +2004,7 @@ mod tests {
20042004
)
20052005
.unwrap();
20062006

2007-
let output = schema.print_schema_tree();
2007+
let output = schema.tree_string();
20082008

20092009
insta::assert_snapshot!(output, @r"
20102010
root
@@ -2042,7 +2042,7 @@ mod tests {
20422042
)
20432043
.unwrap();
20442044

2045-
let output = schema.print_schema_tree();
2045+
let output = schema.tree_string();
20462046
insta::assert_snapshot!(output, @r"
20472047
root
20482048
|-- id: int32 (nullable = false)
@@ -2058,7 +2058,7 @@ mod tests {
20582058
#[test]
20592059
fn test_print_schema_empty() {
20602060
let schema = DFSchema::empty();
2061-
let output = schema.print_schema_tree();
2061+
let output = schema.tree_string();
20622062
insta::assert_snapshot!(output, @r###"root"###);
20632063
}
20642064

@@ -2131,7 +2131,7 @@ mod tests {
21312131
)
21322132
.unwrap();
21332133

2134-
let output = schema.print_schema_tree();
2134+
let output = schema.tree_string();
21352135

21362136
insta::assert_snapshot!(output, @r"
21372137
root
@@ -2174,7 +2174,7 @@ mod tests {
21742174
)
21752175
.unwrap();
21762176

2177-
let output = schema.print_schema_tree();
2177+
let output = schema.tree_string();
21782178

21792179
insta::assert_snapshot!(output, @r"
21802180
root
@@ -2213,7 +2213,7 @@ mod tests {
22132213
)
22142214
.unwrap();
22152215

2216-
let output = schema.print_schema_tree();
2216+
let output = schema.tree_string();
22172217

22182218
insta::assert_snapshot!(output, @r"
22192219
root
@@ -2355,7 +2355,7 @@ mod tests {
23552355
)
23562356
.unwrap();
23572357

2358-
let output = schema.print_schema_tree();
2358+
let output = schema.tree_string();
23592359

23602360
insta::assert_snapshot!(output, @r"
23612361
root
@@ -2430,7 +2430,7 @@ mod tests {
24302430
)
24312431
.unwrap();
24322432

2433-
let output = schema.print_schema_tree();
2433+
let output = schema.tree_string();
24342434

24352435
insta::assert_snapshot!(output, @r"
24362436
root

0 commit comments

Comments
 (0)