GitHub user manygrams opened a pull request:

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

    [SPARK-11270] [STREAMING] Add improved equality testing for 
TopicAndPartition from the Kafka Streaming API

    @jerryshao @tdas 
    
    I know this is kind of minor, and I know you all are busy, but this brings 
this class in line with the `OffsetRange` class, and makes tests a little more 
concise.
    
    Instead of doing something like:
    ```
    assert topic_and_partition_instance._topic == "foo"
    assert topic_and_partition_instance._partition == 0
    ```
    
    You can do something like:
    ```
    assert topic_and_partition_instance == TopicAndPartition("foo", 0)
    ```
    
    Before:
    ```
    >>> from pyspark.streaming.kafka import TopicAndPartition
    >>> TopicAndPartition("foo", 0) == TopicAndPartition("foo", 0)
    False
    ```
    
    After:
    ```
    >>> from pyspark.streaming.kafka import TopicAndPartition
    >>> TopicAndPartition("foo", 0) == TopicAndPartition("foo", 0)
    True
    ```
    
    I couldn't find any tests - am I missing something?

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

    $ git pull https://github.com/manygrams/spark topic_and_partition_equality

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

    https://github.com/apache/spark/pull/9236.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 #9236
    
----
commit bdd9d5b5dcc6c4561a3ea7381cce98ce7c9533f5
Author: Nick Evans <[email protected]>
Date:   2015-10-22T23:27:40Z

    make equality checks on TopicAndPartition compare topic and partition, not 
the instance

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to