nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: zhiburt/tabled
Pull request #392 (2024-02-23 09:10:36)

tabled/ fix Builder::push_column cannot create new rows
- Fixed  #391 

zhiburt: Thanks,

You were right about my take on the empty iterator.

Take care

Patch:
diff --git a/tabled/src/builder/table_builder.rs b/tabled/src/builder/table_builder.rs
index 64318b2..019180d 100644
--- a/tabled/src/builder/table_builder.rs
+++ b/tabled/src/builder/table_builder.rs
@@ -287,6 +287,7 @@ impl Builder {
             }
 
             row.push(text);
+            self.data.push(row);
         }
 
         self.count_columns += 1;


Test patch:
diff --git a/tabled/tests/core/builder_test.rs b/tabled/tests/core/builder_test.rs
index dca4d27..d945f4b 100644
--- a/tabled/tests/core/builder_test.rs
+++ b/tabled/tests/core/builder_test.rs
@@ -129,6 +129,44 @@ test_table!(
     "+---+---+---+---+"
 );
 
+test_table!(
+    push_column_2,
+    {
+        let mut b = Builder::default();
+        b.push_column(["a", "d"]);
+        b.push_column(["b", "e"]);
+        b.push_column(["c", "f"]);
+        b.push_column(["g", "h"]);
+        b.build()
+    },
+    "+---+---+---+---+"
+    "| a | b | c | g |"
+    "+---+---+---+---+"
+    "| d | e | f | h |"
+    "+---+---+---+---+"
+);
+
+test_table!(
+    push_column_3,
+    {
+        let mut b = Builder::default();
+        b.push_column(["a", "d"]);
+        b.push_column(["b", "e"]);
+        b.push_column(["c", "f", "f"]);
+        b.push_column(["g", "h"]);
+        let a: [&str; 0] = [];
+        b.push_column(a);
+        b.build()
+    },
+    "+---+---+---+---+--+"
+    "| a | b | c | g |  |"
+    "+---+---+---+---+--+"
+    "| d | e | f | h |  |"
+    "+---+---+---+---+--+"
+    "|   |   | f |   |  |"
+    "+---+---+---+---+--+"
+);
+
 test_table!(
     insert_column_0,
     {
Repository: yuin/gopher-lua
Pull request #366 (2022-04-14 13:28:19)

fix pr 343
This PR has two issues:

* go-fmt
* changes in generated file



Patch:
diff --git a/_vm.go b/_vm.go
index 874ed9a..049107e 100644
--- a/_vm.go
+++ b/_vm.go
@@ -415,7 +415,7 @@ func init() {
 					if ret.Type() == LTNumber {
 						reg.SetNumber(RA, ret.(LNumber))
 					} else {
-						reg.SetNumber(RA, LNumber(0))
+						reg.Set(RA, ret)
 					}
 				} else if lv.Type() == LTTable {
 					reg.SetNumber(RA, LNumber(lv.(*LTable).Len()))


Test patch:
diff --git a/table_test.go b/table_test.go
index b68808c..6acbbb2 100644
--- a/table_test.go
+++ b/table_test.go
@@ -28,8 +28,8 @@ func TestTableLen(t *testing.T) {
 }
 
 func TestTableLenType(t *testing.T) {
-    L := NewState(Options{})
-    err := L.DoString(`
+	L := NewState(Options{})
+	err := L.DoString(`
         mt = {
             __index = mt,
             __len = function (self)
@@ -46,9 +46,9 @@ func TestTableLenType(t *testing.T) {
 
         print(#v)
     `)
-    if err != nil {
-        t.Error(err)
-    }
+	if err != nil {
+		t.Error(err)
+	}
 }
 
 func TestTableAppend(t *testing.T) {