-
Notifications
You must be signed in to change notification settings - Fork 934
Set up type hinting: add correct types and apply type fixes in schema-registry module #2107
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
Open
fangnx
wants to merge
31
commits into
master
Choose a base branch
from
typehinting-sr-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
c50656f
update
fangnx 343dbfe
remove py.typed for now
fangnx 1e7f2ac
update
fangnx 69ca6b8
fix cimply and add types to serde producer/consumer
fangnx d789244
admin
fangnx 0653fe0
address feedback
fangnx 77c4965
add warning to stub and c files; admin typing more
fangnx cfa723f
add accidentally removed md files
fangnx 1abe216
fix merge conflicts in md files, add types to admin and serialization…
fangnx 8f789a0
finish admin init
fangnx 9c99020
add types for AIO module
fangnx a387ea7
linter fix
fangnx c1e2f91
address mypy complaints
fangnx 8bdb0af
revert some accidental doc change
fangnx 26694e6
fix some suggestions by copilot
fangnx c7865d8
linter
fangnx 791c4ad
fix
fangnx ffb118e
resolve conflict
fangnx d536a71
encryption clients
fangnx cdbd203
fix
fangnx 6fa8730
revert incorrect merge conflict changes
fangnx 485532f
fix many things
fangnx 6262a73
more fixes in non sr modules
fangnx 5ffe301
type encrypt_executor.py
fangnx 0f51247
more typeignore removals
fangnx b4bf42c
update
fangnx 1451647
handle union types in schemas
fangnx 5e718d6
a bit more
fangnx 0ee5103
revert some bad changes during merge, address copilot comments
fangnx 4026889
minor
fangnx 4f0a609
support type hint substitution for unasync
fangnx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| # core test requirements | ||
| urllib3<3 | ||
| flake8 | ||
| mypy | ||
| types-cachetools | ||
| orjson | ||
| pytest | ||
| pytest-timeout | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,8 +19,6 @@ | |||||||||||
|
|
||||||||||||
| import confluent_kafka | ||||||||||||
|
|
||||||||||||
| from .. import _common | ||||||||||||
|
|
||||||||||||
| logger = logging.getLogger(__name__) | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
@@ -108,24 +106,10 @@ def _produce_batch_and_poll() -> int: | |||||||||||
| loop = asyncio.get_running_loop() | ||||||||||||
| return await loop.run_in_executor(self._executor, _produce_batch_and_poll) | ||||||||||||
|
|
||||||||||||
| async def flush_librdkafka_queue(self, timeout=-1): | ||||||||||||
| """Flush the librdkafka queue and wait for all messages to be delivered | ||||||||||||
|
|
||||||||||||
| This method awaits until all outstanding produce requests are completed | ||||||||||||
| or the timeout is reached, unless the timeout is set to 0 (non-blocking). | ||||||||||||
|
|
||||||||||||
| Args: | ||||||||||||
| timeout: Maximum time to wait in seconds: | ||||||||||||
| - -1 = wait indefinitely (default) | ||||||||||||
| - 0 = non-blocking, return immediately | ||||||||||||
| - >0 = wait up to timeout seconds | ||||||||||||
|
|
||||||||||||
| Returns: | ||||||||||||
| Number of messages still in queue after flush attempt | ||||||||||||
| """ | ||||||||||||
| return await _common.async_call(self._executor, self._producer.flush, timeout) | ||||||||||||
|
|
||||||||||||
| def _handle_partial_failures(self, batch_messages: List[Dict[str, Any]]) -> None: | ||||||||||||
| def _handle_partial_failures( | ||||||||||||
| self, | ||||||||||||
| batch_messages: List[Dict[str, Any]] | ||||||||||||
| ) -> None: | ||||||||||||
|
Comment on lines
+125
to
+128
|
||||||||||||
| def _handle_partial_failures( | |
| self, | |
| batch_messages: List[Dict[str, Any]] | |
| ) -> None: | |
| def _handle_partial_failures(self, batch_messages: List[Dict[str, Any]]) -> None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a mutable default argument (empty list) is dangerous as it will be shared across all instances. Use None as default and initialize inside the function instead.