work
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 11 Aug 2025 20:25:55 +0000 (13:25 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 11 Aug 2025 20:25:55 +0000 (13:25 -0700)
rust/pspp/src/dictionary.rs
rust/pspp/src/sys/testdata/bad_variable_name_in_long_string_value_label.expected
rust/pspp/src/sys/testdata/duplicate_value_labels_type.expected
rust/pspp/src/sys/testdata/null_dereference_skipping_bad_extension_record_18.expected
rust/pspp/src/sys/testdata/test-encrypted.expected
rust/pspp/src/sys/testdata/value_labels.expected
rust/pspp/src/sys/testdata/variables_for_value_label_must_all_be_same_type.expected

index e01e8af5b563bbc58d00f4b6d94b46967a6c9847..035c8425c6b8db4c6690d82235264f6dafcdb5c2 100644 (file)
@@ -826,11 +826,15 @@ impl<'a> OutputValueLabels<'a> {
             }
             values.push(group);
         }
-        let mut pt = PivotTable::new([(Axis3::Y, Dimension::new(values))]);
-        for (row, datum) in data.into_iter().enumerate() {
-            pt.insert(&[row], datum);
-        }
-        Some(pt)
+        Some(
+            PivotTable::new([(Axis3::Y, Dimension::new(values))])
+                .with_title("Value Labels")
+                .with_data(
+                    data.into_iter()
+                        .enumerate()
+                        .map(|(row, datum)| ([row], datum)),
+                ),
+        )
     }
 }
 
index d276b3a58c88b4b4ccc5cd501e91161900df2fb3..acdbb3f5a38c67bde1db53b9bbde2e3424b41e95 100644 (file)
@@ -23,6 +23,7 @@ Ignoring long string value label for numeric variable NUM1.
 │str14│       2│     │Nominal          │Input│   14│Left     │A14         │A14         │              │
 ╰─────┴────────┴─────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯
 
+                              Value Labels
 ╭─────────────────────────────┬────────────────────────────────────────╮
 │Variable Value               │                                        │
 ├─────────────────────────────┼────────────────────────────────────────┤
index 5552bcc73c189560fd8578e278bc08313747cdfd..010bb05806efc9c7c105598279decc9283fd04b2 100644 (file)
@@ -23,6 +23,7 @@ NUM1 has duplicate value labels for the following value(s): 1
 │num1│       2│     │                 │Input│    8│Right    │F8.0        │F8.0        │              │
 ╰────┴────────┴─────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯
 
+        Value Labels
 ╭─────────────────────┬───╮
 │Variable Value       │   │
 ├─────────────────────┼───┤
index 5359293d07a6ea939a778948bf2eea9e09aad65d..1cad5bffd3a341cfe4f10b7e4714c5f008ff2b66 100644 (file)
@@ -25,6 +25,7 @@ This system file does not indicate its own character encoding.  For best results
 │VAR00004│       4│     │Nominal          │Input│    8│Left     │A1          │A1          │              │
 ╰────────┴────────┴─────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯
 
+          Value Labels
 ╭───────────────────┬──────────╮
 │Variable Value     │          │
 ├───────────────────┼──────────┤
index 9ec16fbd0798b77a3904313771c0f28fb33b32ad..ef4bf38a55d781fd67a1a4d2fef573faf99c1d17 100644 (file)
@@ -23,6 +23,7 @@
 │There was too much noise in the rooms               │       5│There was too much noise in the rooms               │Ordinal          │Input│    8│Right    │F8.0        │F8.0        │              │
 ╰────────────────────────────────────────────────────┴────────┴────────────────────────────────────────────────────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯
 
+                               Value Labels
 ╭──────────────────────────────────────────────────────┬─────────────────╮
 │Variable Value                                        │                 │
 ├──────────────────────────────────────────────────────┼─────────────────┤
index 8f865a90ee2972d7987c2f56e5bba8f40e43b4d5..50932daee198b29c843d87e1841fb325af7ca198 100644 (file)
@@ -36,6 +36,7 @@
 │str17│      17│     │Nominal          │Input│   17│Left     │A17         │A17         │              │
 ╰─────┴────────┴─────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯
 
+                                           Value Labels
 ╭────────────────────────────────┬───────────────────────────────────────────────────────────────╮
 │Variable Value                  │                                                               │
 ├────────────────────────────────┼───────────────────────────────────────────────────────────────┤
index 6ffdf78056ef83a85bec5347ddc437a3b1a36c96..4302cc3c62d6983b24e268c3aebe0f1295d0a1a0 100644 (file)
@@ -21,6 +21,7 @@ Warning at file offsets 0x110 to 0x118: In value label record: First variable in
 │num1│       2│     │                 │Input│    8│Right    │F8.0        │F8.0        │              │
 ╰────┴────────┴─────┴─────────────────┴─────┴─────┴─────────┴────────────┴────────────┴──────────────╯
 
+        Value Labels
 ╭─────────────────────┬───╮
 │Variable Value       │   │
 ├─────────────────────┼───┤