Skip to content

Commit 2a70526

Browse files
committed
use _bin_op in dataframe.py
1 parent 6bf72bc commit 2a70526

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/pyspark/sql/dataframe.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ def __init__(self, jc):
12751275

12761276
# container operators
12771277
__contains__ = _bin_op("contains")
1278-
__getitem__ = getItem
1278+
__getitem__ = _bin_op("getItem")
12791279

12801280
# bitwise operators
12811281
bitwiseOR = _bin_op("bitwiseOR")
@@ -1300,7 +1300,7 @@ def getItem(self, key):
13001300
| 1| value|
13011301
+----+------+
13021302
"""
1303-
return Column(self._jc.getItem(key))
1303+
return self[key]
13041304

13051305
def getField(self, name):
13061306
"""An expression that gets a field by name in a StructField.
@@ -1320,7 +1320,7 @@ def getField(self, name):
13201320
| 1|
13211321
+---+
13221322
"""
1323-
return Column(self._jc.getField(name))
1323+
return self[name]
13241324

13251325
def __getattr__(self, item):
13261326
if item.startswith("__"):

0 commit comments

Comments
 (0)