Skip to content

Invalid use of types in error messages in definition.py #31

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

Closed
hdiode-florian opened this issue Jul 8, 2022 · 4 comments
Closed

Invalid use of types in error messages in definition.py #31

hdiode-florian opened this issue Jul 8, 2022 · 4 comments

Comments

@hdiode-florian
Copy link

Describe the bug
In several places https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/python/pulsar/schema/definition.py uses incorrect type (name) to string conversions when exceptions are raised, for example:
https://github.com/apache/pulsar/blob/66e8206f129a7ea303099af1317f78652240f985/pulsar-client-cpp/python/pulsar/schema/definition.py#L29

To Reproduce

from pulsar.schema import Array, Integer
f = Array(Integer)
TypeError: can only concatenate str (not "type") to str

Expected behavior

Exception: Argument Integer is not a Record or a Field

Additional context
The same mistake was made in several places in that file.

@github-actions
Copy link

github-actions bot commented Aug 7, 2022

The issue had no activity for 30 days, mark with Stale label.

@tisonkun tisonkun transferred this issue from apache/pulsar Nov 10, 2022
@tisonkun
Copy link
Member

cc @BewareMyPower @shibd @merlimat

There's a previous patch at apache/pulsar#16459.

erichare added a commit to erichare/pulsar-client-python that referenced this issue Feb 6, 2023
BewareMyPower pushed a commit that referenced this issue Feb 13, 2023
Addresses Issue #31 - we should access a string representation of the given object rather than assuming that the object itself can be concatenated with a string.
@erichare
Copy link
Contributor

@BewareMyPower I think we can close this now that it's been merged in. Thanks!

@tisonkun
Copy link
Member

@erichare Thanks for your updates! Closing...

BewareMyPower pushed a commit that referenced this issue Feb 16, 2023
Addresses Issue #31 - we should access a string representation of the given object rather than assuming that the object itself can be concatenated with a string.

(cherry picked from commit e3eed2d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants