You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/21 22:17:21 UTC
[GitHub] [spark] ueshin opened a new pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
ueshin opened a new pull request #33005:
URL: https://github.com/apache/spark/pull/33005
### What changes were proposed in this pull request?
Properly set `InternalField` for `DataTypeOps.isnull`.
### Why are the changes needed?
The result of `DataTypeOps.isnull` must always be non-nullable boolean.
We should manage `InternalField` for this case.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Added some more tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-866231969
**[Test build #140160 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140160/testReport)** for PR 33005 at commit [`833e0dd`](https://github.com/apache/spark/commit/833e0dd0901bded8a36aa4ab7584840001c9dc39).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865385995
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-866271147
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-866231969
**[Test build #140160 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140160/testReport)** for PR 33005 at commit [`833e0dd`](https://github.com/apache/spark/commit/833e0dd0901bded8a36aa4ab7584840001c9dc39).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin commented on a change in pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
ueshin commented on a change in pull request #33005:
URL: https://github.com/apache/spark/pull/33005#discussion_r655740724
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
self.check_extension(pser, psser.to_pandas())
self.check_extension(ps.from_pandas(pser), psser)
+ def test_isnull(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
+ self.check_extension(pser.isnull(), psser.isnull())
+
@unittest.skipIf(
not extension_float_dtypes_available, "pandas extension float dtypes are not available"
)
class FractionalExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [0.1, 0.2, 0.3, None]
+ @property
+ def fractional_extension_psers(self):
dtypes = ["Float32", "Float64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([0.1, 0.2, 0.3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def fractional_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.fractional_extension_psers]
+
+ @property
+ def fractional_extension_pser_psser_pairs(self):
+ return zip(self.fractional_extension_psers, self.fractional_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.fractional_extension_pser_psser_pairs:
Review comment:
ditto.
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
Review comment:
@xinrong-databricks Is this change fine?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-866262076
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44686/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865506020
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44641/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865479472
**[Test build #140113 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140113/testReport)** for PR 33005 at commit [`9f42339`](https://github.com/apache/spark/commit/9f4233971b1bb3b2bd56654ffbb5000ebcfd769e).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-866267950
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44686/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-866263355
**[Test build #140160 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140160/testReport)** for PR 33005 at commit [`833e0dd`](https://github.com/apache/spark/commit/833e0dd0901bded8a36aa4ab7584840001c9dc39).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865409032
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865401719
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44629/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865499147
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140113/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865385995
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
ueshin commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-866287406
Thanks! merging to master.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] xinrong-databricks commented on a change in pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #33005:
URL: https://github.com/apache/spark/pull/33005#discussion_r656463509
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
self.check_extension(pser, psser.to_pandas())
self.check_extension(ps.from_pandas(pser), psser)
+ def test_isnull(self):
Review comment:
Thanks for adding the tests!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] xinrong-databricks commented on a change in pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #33005:
URL: https://github.com/apache/spark/pull/33005#discussion_r656463641
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
self.check_extension(pser, psser.to_pandas())
self.check_extension(ps.from_pandas(pser), psser)
+ def test_isnull(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
+ self.check_extension(pser.isnull(), psser.isnull())
+
@unittest.skipIf(
not extension_float_dtypes_available, "pandas extension float dtypes are not available"
)
class FractionalExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [0.1, 0.2, 0.3, None]
+ @property
+ def fractional_extension_psers(self):
dtypes = ["Float32", "Float64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([0.1, 0.2, 0.3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def fractional_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.fractional_extension_psers]
+
+ @property
+ def fractional_extension_pser_psser_pairs(self):
+ return zip(self.fractional_extension_psers, self.fractional_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.fractional_extension_pser_psser_pairs:
Review comment:
Looks fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865385995
**[Test build #140101 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140101/testReport)** for PR 33005 at commit [`099e9de`](https://github.com/apache/spark/commit/099e9de593e7b421c8d9109e1890defa7bd42b22).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-866271147
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865518196
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44641/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Yikun commented on a change in pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
Yikun commented on a change in pull request #33005:
URL: https://github.com/apache/spark/pull/33005#discussion_r655920162
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
self.check_extension(pser, psser.to_pandas())
self.check_extension(ps.from_pandas(pser), psser)
+ def test_isnull(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
+ self.check_extension(pser.isnull(), psser.isnull())
Review comment:
```python
self.assert_eq(self.pser.isnull(), self.psser.isnull())
```
It should be `assert_eq`, the `psser.isnull()` return value is not ExtensionDtypes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865499147
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140113/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865479472
**[Test build #140113 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140113/testReport)** for PR 33005 at commit [`9f42339`](https://github.com/apache/spark/commit/9f4233971b1bb3b2bd56654ffbb5000ebcfd769e).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin commented on a change in pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
ueshin commented on a change in pull request #33005:
URL: https://github.com/apache/spark/pull/33005#discussion_r655740724
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
self.check_extension(pser, psser.to_pandas())
self.check_extension(ps.from_pandas(pser), psser)
+ def test_isnull(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
+ self.check_extension(pser.isnull(), psser.isnull())
+
@unittest.skipIf(
not extension_float_dtypes_available, "pandas extension float dtypes are not available"
)
class FractionalExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [0.1, 0.2, 0.3, None]
+ @property
+ def fractional_extension_psers(self):
dtypes = ["Float32", "Float64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([0.1, 0.2, 0.3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def fractional_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.fractional_extension_psers]
+
+ @property
+ def fractional_extension_pser_psser_pairs(self):
+ return zip(self.fractional_extension_psers, self.fractional_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.fractional_extension_pser_psser_pairs:
Review comment:
ditto.
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
Review comment:
@xinrong-databricks Is this change fine?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin commented on a change in pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
ueshin commented on a change in pull request #33005:
URL: https://github.com/apache/spark/pull/33005#discussion_r656448203
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
self.check_extension(pser, psser.to_pandas())
self.check_extension(ps.from_pandas(pser), psser)
+ def test_isnull(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
+ self.check_extension(pser.isnull(), psser.isnull())
Review comment:
Yeah, that's right. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin closed pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
ueshin closed pull request #33005:
URL: https://github.com/apache/spark/pull/33005
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
ueshin commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865381547
cc @xinrong-databricks @Yikun
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865409032
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865385995
**[Test build #140101 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140101/testReport)** for PR 33005 at commit [`099e9de`](https://github.com/apache/spark/commit/099e9de593e7b421c8d9109e1890defa7bd42b22).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] ueshin commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
ueshin commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865381547
cc @xinrong-databricks @Yikun
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865518196
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44641/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865494619
**[Test build #140113 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140113/testReport)** for PR 33005 at commit [`9f42339`](https://github.com/apache/spark/commit/9f4233971b1bb3b2bd56654ffbb5000ebcfd769e).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds the following public classes _(experimental)_:
* `class SparkIndexOpsMethods(Generic[T_IndexOps], metaclass=ABCMeta):`
* `class SparkSeriesMethods(SparkIndexOpsMethods[\"ps.Series\"]):`
* `class SparkIndexMethods(SparkIndexOpsMethods[\"ps.Index\"]):`
* `case class GetTimestampWithoutTZ(`
* `case class ParseToTimestampWithoutTZ(`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] xinrong-databricks commented on a change in pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
xinrong-databricks commented on a change in pull request #33005:
URL: https://github.com/apache/spark/pull/33005#discussion_r656463373
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
Review comment:
Certainly!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865396378
**[Test build #140101 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140101/testReport)** for PR 33005 at commit [`099e9de`](https://github.com/apache/spark/commit/099e9de593e7b421c8d9109e1890defa7bd42b22).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865409032
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865503366
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44641/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865405096
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44629/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33005:
URL: https://github.com/apache/spark/pull/33005#issuecomment-865409032
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Yikun commented on a change in pull request #33005: [SPARK-35847][PYTHON] Manage InternalField in DataTypeOps.isnull
Posted by GitBox <gi...@apache.org>.
Yikun commented on a change in pull request #33005:
URL: https://github.com/apache/spark/pull/33005#discussion_r655920162
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_num_ops.py
##########
@@ -320,29 +320,55 @@ def test_astype(self):
@unittest.skipIf(not extension_dtypes_available, "pandas extension dtypes are not available")
class IntegralExtensionOpsTest(PandasOnSparkTestCase, TestCasesUtils):
- def test_from_to_pandas(self):
- data = [1, 2, 3, None]
+ @property
+ def intergral_extension_psers(self):
dtypes = ["Int8", "Int16", "Int32", "Int64"]
- for dtype in dtypes:
- pser = pd.Series(data, dtype=dtype)
- psser = ps.Series(data, dtype=dtype)
+ return [pd.Series([1, 2, 3, None], dtype=dtype) for dtype in dtypes]
+
+ @property
+ def intergral_extension_pssers(self):
+ return [ps.from_pandas(pser) for pser in self.intergral_extension_psers]
+
+ @property
+ def intergral_extension_pser_psser_pairs(self):
+ return zip(self.intergral_extension_psers, self.intergral_extension_pssers)
+
+ def test_from_to_pandas(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
self.check_extension(pser, psser.to_pandas())
self.check_extension(ps.from_pandas(pser), psser)
+ def test_isnull(self):
+ for pser, psser in self.intergral_extension_pser_psser_pairs:
+ self.check_extension(pser.isnull(), psser.isnull())
Review comment:
```python
self.assert_eq(self.pser.isnull(), self.psser.isnull())
```
It should be `assert_eq`, the `psser.isnull()` return value is not ExtensionDtypes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org