Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Provide __str__ operator for BytesSchema #12593

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

merlimat
Copy link
Contributor

@merlimat merlimat commented Nov 2, 2021

Motivation

When generating the Python docs, we're always getting a diff in the generated HTML files:

diff --git content/api/python/2.10.0-SNAPSHOT/index.html content/api/python/2.10.0-SNAPSHOT/index.html
index 7ca1187b385..3024cd47437 100644
--- content/api/python/2.10.0-SNAPSHOT/index.html
+++ content/api/python/2.10.0-SNAPSHOT/index.html
@@ -3764,7 +3764,7 @@ producers and consumers.</p></div>

   <div class="item">
     <div class="name def" id="pulsar.Client.create_producer">
-    <p>def <span class="ident">create_producer</span>(</p><p>self, topic, producer_name=None, schema=&lt;pulsar.schema.schema.BytesSchema object at 0x7fe2f58e8b90&gt;, initial_sequence_id=None, send_timeout_millis=30000, compres
+    <p>def <span class="ident">create_producer</span>(</p><p>self, topic, producer_name=None, schema=&lt;pulsar.schema.schema.BytesSchema object at 0x7ff062143b90&gt;, initial_sequence_id=None, send_timeout_millis=30000, compres
     </div>


@@ -4018,7 +4018,7 @@ batched into single batch message:

   <div class="item">
     <div class="name def" id="pulsar.Client.create_reader">
-    <p>def <span class="ident">create_reader</span>(</p><p>self, topic, start_message_id, schema=&lt;pulsar.schema.schema.BytesSchema object at 0x7fe2ede71090&gt;, reader_listener=None, receiver_queue_size=1000, reader_name=None
+    <p>def <span class="ident">create_reader</span>(</p><p>self, topic, start_message_id, schema=&lt;pulsar.schema.schema.BytesSchema object at 0x7ff061239090&gt;, reader_listener=None, receiver_queue_size=1000, reader_name=None
     </div>


@@ -4235,7 +4235,7 @@ for ongoing operations to complete.</p></div>

   <div class="item">
     <div class="name def" id="pulsar.Client.subscribe">
-    <p>def <span class="ident">subscribe</span>(</p><p>self, topic, subscription_name, consumer_type=_pulsar.ConsumerType.Exclusive, schema=&lt;pulsar.schema.schema.BytesSchema object at 0x7fe2ede62f90&gt;, message_listener=None
+    <p>def <span class="ident">subscribe</span>(</p><p>self, topic, subscription_name, consumer_type=_pulsar.ConsumerType.Exclusive, schema=&lt;pulsar.schema.schema.BytesSchema object at 0x7ff06122af90&gt;, message_listener=None
     </div>

This is due to BytesSchema not having a __str__() method and thus returning a different string each time, like: <pulsar.schema.schema.BytesSchema object at 0x7fe2f58e8b90>.

@merlimat merlimat added area/build component/python doc-not-needed Your PR changes do not impact docs labels Nov 2, 2021
@merlimat merlimat added this to the 2.10.0 milestone Nov 2, 2021
@merlimat merlimat self-assigned this Nov 2, 2021
@merlimat merlimat merged commit f982c49 into apache:master Nov 3, 2021
codelipenghui pushed a commit that referenced this pull request Nov 18, 2021
@codelipenghui codelipenghui added release/2.8.2 cherry-picked/branch-2.8 Archived: 2.8 is end of life and removed release/2.8.3 labels Nov 18, 2021
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants