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 2022/09/20 09:23:57 UTC
[GitHub] [spark] zhengruifeng opened a new pull request, #37947: [SPARK-40500][PS] Use `pd.items` instead of `pd.iteritems`
zhengruifeng opened a new pull request, #37947:
URL: https://github.com/apache/spark/pull/37947
### What changes were proposed in this pull request?
Use `pd.items` instead of `pd.iteritems`
### Why are the changes needed?
`pd.iteritems` is deprecated in 1.5
before:
```
In [4]: import pyspark.pandas as ps
In [5]: ps.Series([3, 4, 1, 1, 5])
/Users/ruifeng.zheng/Dev/spark/python/pyspark/pandas/internal.py:1573: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
fields = [
/Users/ruifeng.zheng/Dev/spark/python/pyspark/sql/pandas/conversion.py:486: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.
for column, series in pdf.iteritems():
0 3
1 4
2 1
3 1
4 5
dtype: int64
```
after:
```
In [1]: import pyspark.pandas as ps
In [2]: ps.Series([3, 4, 1, 1, 5])
0 3
1 4
2 1
3 1
4 5
dtype: int64
```
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
existing UT
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] HyukjinKwon commented on pull request #37947: [SPARK-40500][PS] Use `pd.items` instead of `pd.iteritems`
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #37947:
URL: https://github.com/apache/spark/pull/37947#issuecomment-1253079820
Yeah let's match w/ pandas
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] HyukjinKwon commented on pull request #37947: [SPARK-40500][PS] Deprecate `iteritems` in DataFrame and Seriese
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #37947:
URL: https://github.com/apache/spark/pull/37947#issuecomment-1253116817
Merged 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] zhengruifeng commented on pull request #37947: [SPARK-40500][PS] Use `pd.items` instead of `pd.iteritems`
Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on PR #37947:
URL: https://github.com/apache/spark/pull/37947#issuecomment-1253073004
remaining `iteritems`s in `frame.py` and `test_dataframe.py` are the definition and tests of PS's `iteritems` itself, so I think we should not modify them.
as to the deprecation of PS's `iteritems`, I think we can deprecate them now, WDYT @itholic @HyukjinKwon @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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] HyukjinKwon commented on a diff in pull request #37947: [SPARK-40500][PS] Deprecate `iteritems` in DataFrame and Seriese
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37947:
URL: https://github.com/apache/spark/pull/37947#discussion_r975968699
##########
python/pyspark/pandas/frame.py:
##########
@@ -2054,9 +2054,16 @@ def extract_kv_from_spark_row(row: Row) -> Tuple[Name, Any]:
):
yield tuple(([k] if index else []) + list(v))
- def items(self) -> Iterator[Tuple[Name, "Series"]]:
- """This is an alias of ``iteritems``."""
- return self.iteritems()
+ def iteritems(self) -> Iterator[Tuple[Name, "Series"]]:
+ """
+ This is an alias of ``items``.
+
+ .. deprecated:: 3.4.0
+ iteritems is deprecated and will be removed in a future version.
+ Use .items instead.
+ """
+ warnings.warn("Deprecated in 3.4, Use DataFrame.items instead.", FutureWarning)
Review Comment:
```suggestion
warnings.warn("Deprecated in 3.4.0, Use DataFrame.items instead.", FutureWarning)
```
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] zhengruifeng commented on pull request #37947: [SPARK-40500][PS] Deprecate `iteritems` in DataFrame and Seriese
Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on PR #37947:
URL: https://github.com/apache/spark/pull/37947#issuecomment-1253118512
Thank you all!
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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] HyukjinKwon closed pull request #37947: [SPARK-40500][PS] Deprecate `iteritems` in DataFrame and Seriese
Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #37947: [SPARK-40500][PS] Deprecate `iteritems` in DataFrame and Seriese
URL: https://github.com/apache/spark/pull/37947
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
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