Skip to content

Conversation

@papigers
Copy link
Contributor

@papigers papigers commented Nov 5, 2025

Description

Incorrect wrapping of close() results in the following error:

TypeError: ConfluentKafkaInstrumentor._instrument.<locals>._inner_wrap_close() takes 2 positional arguments but 4 were given

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@papigers papigers requested a review from a team as a code owner November 5, 2025 12:39
@papigers papigers force-pushed the confluent-kafka-fix-close-incorrect-num-args branch from f72ac65 to 6dbb8eb Compare November 5, 2025 12:42
@papigers
Copy link
Contributor Author

papigers commented Nov 5, 2025

@emdneto hoping that you can help with CR here 🙏

[project.optional-dependencies]
instruments = [
"confluent-kafka >= 1.8.2, <= 2.11.0",
"confluent-kafka >= 1.8.2, <= 2.11.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of bumping to < 2.12.0? Can we expect to not break?



_instruments = ("confluent-kafka >= 1.8.2, <= 2.11.0",)
_instruments = ("confluent-kafka >= 1.8.2, <= 2.11.1",)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

self._current_context_token = None

def close(self):
def close(self, *args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that has been changed in 2.11.1 or has been there already? Maybe we should add a docker test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally only started using in that version, but it doesn't seem to be relevant to confluent Kafka itself, looks to be a change in wrapt that someone forgot to update here

@xrmx xrmx moved this to Ready for review in @xrmx's Python PR digest Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

3 participants