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

Update consumer.rst documentation for correct ordering of consumer su… #901

Merged
merged 1 commit into from
Dec 9, 2023

Conversation

wbarnha
Copy link
Member

@wbarnha wbarnha commented Jun 14, 2023

…bscription by pattern

Changes

Fixes documentation for consumer subscription by regex pattern.

Whenever I invoked, as the documentation specifies:

await consumer.start()
consumer.subscribe(pattern="^MyGreatTopic-.*$")

I always get errors indicating the following:

Traceback (most recent call last):
  File "/home/REDACTED/PycharmProjects/REDACTED", line REDACTED, in REDACTED
    await consumer.start()
  File "/home/REDACTED/PycharmProjects/REDACTED", line REDACTED, in REDACTED
    await consumer.seek_to_end()
  File "/home/REDACTED/PycharmProjects/REDACTED/venv/lib/python3.8/site-packages/aiokafka/consumer/consumer.py", line 824, in seek_to_end
    assert partitions, 'No partitions are currently assigned'
AssertionError: No partitions are currently assigned

When I run the following, my application works fine:

consumer.subscribe(pattern="^MyGreatTopic-.*$")
await consumer.start()

Or is there something I'm misunderstanding in the documentation?

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.

@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Merging #901 (dcb8494) into master (5ce5649) will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #901      +/-   ##
==========================================
- Coverage   97.59%   97.56%   -0.04%     
==========================================
  Files          30       30              
  Lines        5451     5451              
==========================================
- Hits         5320     5318       -2     
- Misses        131      133       +2     
Flag Coverage Δ
cext 88.36% <ø> (-0.04%) ⬇️
integration 97.52% <ø> (-0.04%) ⬇️
purepy 97.10% <ø> (-0.04%) ⬇️
unit 38.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wbarnha wbarnha self-assigned this Jul 6, 2023
@ods ods merged commit b1a3dfc into aio-libs:master Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants