GitHub user kokes opened a pull request:

    https://github.com/apache/spark/pull/21654

    [SPARK-24671][PySpark] DataFrame length using a dunder/magic method

    ## What changes were proposed in this pull request?
    
    `len(df)` should work by implementing `__len__` method on class 
`DataFrame`, this just invokes `self.count()`
    
    ## How was this patch tested?
    
    It was not, because local tests failed early on (lint-scala), before they 
got to PySpark and I wasn't sure how to skip them. I'm relying on Jenkins here.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kokes/spark dflen

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/21654.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #21654
    
----
commit 4d0afaf3cd046b11e8bae43dc00ddf4b1eb97732
Author: Ondrej Kokes <ondrej.kokes@...>
Date:   2018-06-27T19:50:58Z

    len(df) == df.count()

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to