[GitHub] spark pull request #12790: [SPARK-15018][PYSPARK][ML] Fixed bug causing erro...

2016-08-18 Thread BryanCutler
Github user BryanCutler commented on a diff in the pull request:

https://github.com/apache/spark/pull/12790#discussion_r75392014
  
--- Diff: python/pyspark/status.py ---
@@ -83,6 +85,8 @@ def getJobInfo(self, jobId):
 job = self._jtracker.getJobInfo(jobId)
 if job is not None:
 return SparkJobInfo(jobId, job.stageIds(), str(job.status()))
+else:
--- End diff --

Yeah, I know...  Hmmm, this is from something else, not sure how it got 
mixed in.  Let me remove it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #12790: [SPARK-15018][PYSPARK][ML] Fixed bug causing erro...

2016-08-18 Thread MechCoder
Github user MechCoder commented on a diff in the pull request:

https://github.com/apache/spark/pull/12790#discussion_r75390810
  
--- Diff: python/pyspark/status.py ---
@@ -83,6 +85,8 @@ def getJobInfo(self, jobId):
 job = self._jtracker.getJobInfo(jobId)
 if job is not None:
 return SparkJobInfo(jobId, job.stageIds(), str(job.status()))
+else:
--- End diff --

Python returns None by default ;)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #12790: [SPARK-15018][PYSPARK][ML] Fixed bug causing erro...

2016-08-17 Thread BryanCutler
Github user BryanCutler commented on a diff in the pull request:

https://github.com/apache/spark/pull/12790#discussion_r75229691
  
--- Diff: python/pyspark/ml/tests.py ---
@@ -230,6 +230,15 @@ def test_pipeline(self):
 self.assertEqual(5, transformer3.dataset_index)
 self.assertEqual(6, dataset.index)
 
+def test_identity_pipeline(self):
+dataset = MockDataset()
+
+def doTransform(pipeline):
+pipeline_model = pipeline.fit(dataset)
+return pipeline_model.transform(dataset)
+self.assertEqual(dataset.index, doTransform(Pipeline()).index)
+self.assertEqual(dataset.index, 
doTransform(Pipeline(stages=[])).index)
--- End diff --

Maybe, but these are no different than any other param and we usually don't 
test that we can get/set each one.  I think it's safe to assume that 
`setParams` will set the given value and `getStages` will return the value set 
or default.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #12790: [SPARK-15018][PYSPARK][ML] Fixed bug causing erro...

2016-08-17 Thread BryanCutler
Github user BryanCutler commented on a diff in the pull request:

https://github.com/apache/spark/pull/12790#discussion_r75229100
  
--- Diff: python/pyspark/ml/pipeline.py ---
@@ -57,9 +57,8 @@ def __init__(self, stages=None):
 """
 __init__(self, stages=None)
 """
-if stages is None:
-stages = []
 super(Pipeline, self).__init__()
+self._setDefault(stages=[])
--- End diff --

Sure


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #12790: [SPARK-15018][PYSPARK][ML] Fixed bug causing erro...

2016-08-16 Thread MechCoder
Github user MechCoder commented on a diff in the pull request:

https://github.com/apache/spark/pull/12790#discussion_r75024959
  
--- Diff: python/pyspark/ml/pipeline.py ---
@@ -57,9 +57,8 @@ def __init__(self, stages=None):
 """
 __init__(self, stages=None)
 """
-if stages is None:
-stages = []
 super(Pipeline, self).__init__()
+self._setDefault(stages=[])
--- End diff --

Could you add a comment on why this is being done for future reference?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #12790: [SPARK-15018][PYSPARK][ML] Fixed bug causing erro...

2016-08-16 Thread MechCoder
Github user MechCoder commented on a diff in the pull request:

https://github.com/apache/spark/pull/12790#discussion_r75023876
  
--- Diff: python/pyspark/ml/tests.py ---
@@ -230,6 +230,15 @@ def test_pipeline(self):
 self.assertEqual(5, transformer3.dataset_index)
 self.assertEqual(6, dataset.index)
 
+def test_identity_pipeline(self):
+dataset = MockDataset()
+
+def doTransform(pipeline):
+pipeline_model = pipeline.fit(dataset)
+return pipeline_model.transform(dataset)
+self.assertEqual(dataset.index, doTransform(Pipeline()).index)
+self.assertEqual(dataset.index, 
doTransform(Pipeline(stages=[])).index)
--- End diff --

Should we also check that `setParams(stages=[])` and 
`Pipeline().getStages()` return the expected value?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org