You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by li...@apache.org on 2018/09/10 17:35:42 UTC

spark git commit: Revert "[SPARK-25072][PYSPARK] Forbid extra value for custom Row"

Repository: spark
Updated Branches:
  refs/heads/branch-2.3 5ad644a4c -> 4b578184f


Revert "[SPARK-25072][PYSPARK] Forbid extra value for custom Row"

This reverts commit 31dab7140a4b271e7b976762af7a36f8bfbb8381.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/4b578184
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/4b578184
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/4b578184

Branch: refs/heads/branch-2.3
Commit: 4b578184f3e450e564f8c8b0b1ec67f5cf0f1451
Parents: 5ad644a
Author: gatorsmile <ga...@gmail.com>
Authored: Mon Sep 10 10:34:04 2018 -0700
Committer: gatorsmile <ga...@gmail.com>
Committed: Mon Sep 10 10:34:04 2018 -0700

----------------------------------------------------------------------
 python/pyspark/sql/tests.py | 4 ----
 python/pyspark/sql/types.py | 3 ---
 2 files changed, 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/4b578184/python/pyspark/sql/tests.py
----------------------------------------------------------------------
diff --git a/python/pyspark/sql/tests.py b/python/pyspark/sql/tests.py
index 374db54..6bfb329 100644
--- a/python/pyspark/sql/tests.py
+++ b/python/pyspark/sql/tests.py
@@ -268,10 +268,6 @@ class DataTypeTests(unittest.TestCase):
         struct_field = StructField("a", IntegerType())
         self.assertRaises(TypeError, struct_field.typeName)
 
-    def test_invalid_create_row(self):
-        row_class = Row("c1", "c2")
-        self.assertRaises(ValueError, lambda: row_class(1, 2, 3))
-
 
 class SQLTests(ReusedSQLTestCase):
 

http://git-wip-us.apache.org/repos/asf/spark/blob/4b578184/python/pyspark/sql/types.py
----------------------------------------------------------------------
diff --git a/python/pyspark/sql/types.py b/python/pyspark/sql/types.py
index 8a8cd8d..cd85740 100644
--- a/python/pyspark/sql/types.py
+++ b/python/pyspark/sql/types.py
@@ -1532,9 +1532,6 @@ class Row(tuple):
     # let object acts like class
     def __call__(self, *args):
         """create new Row object"""
-        if len(args) > len(self):
-            raise ValueError("Can not create Row with fields %s, expected %d values "
-                             "but got %s" % (self, len(self), args))
         return _create_row(self, args)
 
     def __getitem__(self, item):


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org