You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by di...@apache.org on 2023/07/06 14:59:19 UTC

[kafka] branch trunk updated: KAFKA-15153: Use Python 'is' instead of '==' to compare for None (#13964)

This is an automated email from the ASF dual-hosted git repository.

divijv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 4149e31cadd KAFKA-15153: Use Python 'is' instead of '==' to compare for None (#13964)
4149e31cadd is described below

commit 4149e31caddd859376f36f5e020c567b40b9ab9f
Author: DL1231 <53...@users.noreply.github.com>
AuthorDate: Thu Jul 6 22:59:13 2023 +0800

    KAFKA-15153: Use Python 'is' instead of '==' to compare for None (#13964)
    
    Reviewers: Divij Vaidya <di...@amazon.com>
    
    Co-authored-by: d00791190 <di...@huawei.com>
---
 release_notes.py                              | 2 +-
 tests/kafkatest/tests/client/consumer_test.py | 2 +-
 tests/kafkatest/tests/connect/connect_test.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/release_notes.py b/release_notes.py
index e44c74d5b22..e74fd470888 100755
--- a/release_notes.py
+++ b/release_notes.py
@@ -44,7 +44,7 @@ def get_issues(jira, query, **kwargs):
     results = []
     startAt = 0
     new_results = None
-    while new_results == None or len(new_results) == MAX_RESULTS:
+    while new_results is None or len(new_results) == MAX_RESULTS:
         new_results = jira.search_issues(query, startAt=startAt, maxResults=MAX_RESULTS, **kwargs)
         results += new_results
         startAt += len(new_results)
diff --git a/tests/kafkatest/tests/client/consumer_test.py b/tests/kafkatest/tests/client/consumer_test.py
index 49e9331f613..3b535c97251 100644
--- a/tests/kafkatest/tests/client/consumer_test.py
+++ b/tests/kafkatest/tests/client/consumer_test.py
@@ -334,7 +334,7 @@ class OffsetValidationTest(VerifiableConsumerTest):
 
         # stop the partition owner and await its shutdown
         consumer.kill_node(partition_owner, clean_shutdown=clean_shutdown)
-        wait_until(lambda: len(consumer.joined_nodes()) == (self.num_consumers - 1) and consumer.owner(partition) != None,
+        wait_until(lambda: len(consumer.joined_nodes()) == (self.num_consumers - 1) and consumer.owner(partition) is not None,
                    timeout_sec=self.session_timeout_sec*2+5,
                    err_msg="Timed out waiting for consumer to close")
 
diff --git a/tests/kafkatest/tests/connect/connect_test.py b/tests/kafkatest/tests/connect/connect_test.py
index aa70cfe89a4..312c10a0ebf 100644
--- a/tests/kafkatest/tests/connect/connect_test.py
+++ b/tests/kafkatest/tests/connect/connect_test.py
@@ -79,7 +79,7 @@ class ConnectStandaloneFileTest(Test):
         parameterizations to test different converters (which also test per-connector converter overrides), schema/schemaless
         modes, and security support.
         """
-        assert converter != None, "converter type must be set"
+        assert converter is not None, "converter type must be set"
         # Template parameters. Note that we don't set key/value.converter. These default to JsonConverter and we validate
         # converter overrides via the connector configuration.
         if converter != "org.apache.kafka.connect.json.JsonConverter":