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

[PyAMQP] Kashif Client refactoring changes #25451

Merged
49 commits merged into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
912c993
init changes to client
kashifkhan Jul 18, 2022
1a5faf2
fix doctring
kashifkhan Jul 18, 2022
20fbe03
remove error
kashifkhan Jul 18, 2022
18599d5
cleanup
kashifkhan Jul 27, 2022
943f0d6
further clean up
kashifkhan Jul 27, 2022
179321a
fix tests
kashifkhan Jul 27, 2022
e880b9c
tweaks
kashifkhan Jul 27, 2022
cf66a14
fix import
kashifkhan Jul 27, 2022
7424d4a
fix unit tests
kashifkhan Jul 27, 2022
592046d
fix var
kashifkhan Jul 27, 2022
65c628c
looking into removing hostname on SDK side -- new branch so not messy
l0lawrence Jul 28, 2022
a7599a4
test-fix
l0lawrence Jul 28, 2022
07dd588
switch to kwargs
l0lawrence Jul 28, 2022
ba4b04d
SendClient had no docstring
l0lawrence Aug 1, 2022
ec307a5
adding back in hostname
l0lawrence Aug 1, 2022
45d9587
making send client param keyword instead
l0lawrence Aug 1, 2022
31a5380
making param to keyword in recieveClient docstring
l0lawrence Aug 1, 2022
293da9d
final uamqp docstring comments - need advice
l0lawrence Aug 1, 2022
f1f2f1b
renaming mesage to message
l0lawrence Aug 1, 2022
03bf52c
removing comment about typo
l0lawrence Aug 1, 2022
00b1815
hostname type string
l0lawrence Aug 1, 2022
f498d10
fixing tests
l0lawrence Aug 18, 2022
3a43101
removing print
l0lawrence Aug 18, 2022
306e097
adding hostname
l0lawrence Aug 18, 2022
88be0cc
Merge branch 'feature/eventhub/pyproto' of https://github.com/Azure/a…
l0lawrence Aug 18, 2022
72662d9
Merge branch 'feature/eventhub/pyproto' of https://github.com/Azure/a…
l0lawrence Aug 22, 2022
1dad77d
retry spelled wrong
l0lawrence Aug 22, 2022
33b18eb
Merge branch 'feature/eventhub/pyproto' into kashif_client_changes
l0lawrence Aug 25, 2022
f687953
git conflict
l0lawrence Aug 25, 2022
44c4279
removing some todos
l0lawrence Aug 25, 2022
50211ef
async
l0lawrence Aug 25, 2022
266dd2f
syncing together docs
l0lawrence Aug 25, 2022
d97ff8a
adding in InternalError on client_ready()
l0lawrence Aug 26, 2022
b26d4c6
made private var public
l0lawrence Aug 26, 2022
838383e
removing pylint disable to see
l0lawrence Aug 26, 2022
75598b3
remove auto add
l0lawrence Aug 26, 2022
6fb6ad8
initial pr fixes
l0lawrence Aug 29, 2022
019350a
removing desired_capabilities for now, spelling fix adding keywords f…
l0lawrence Aug 29, 2022
5e08d07
adding back in desired_cap -- used by consumer
l0lawrence Aug 29, 2022
8272c83
adding docstring patch for review
l0lawrence Aug 30, 2022
4bd01ae
auth as keyword
l0lawrence Aug 30, 2022
9c518f1
renaming prefetch to link_credit to match code
l0lawrence Aug 30, 2022
b67fa9c
swathi pr comments
l0lawrence Aug 30, 2022
8a83c0e
making pr comment changes
l0lawrence Aug 31, 2022
b1f34b4
nonetype err
l0lawrence Aug 31, 2022
6c4e933
fixing docstring async
l0lawrence Aug 31, 2022
e817f4b
making this uniform with sync side
l0lawrence Aug 31, 2022
ced95bc
fixing leftover doc issue
l0lawrence Aug 31, 2022
975db59
str->bytes, removing __doc__ override
l0lawrence Sep 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _get_partitions(self):
for p_id in cast(List[str], self._partition_ids):
self._producers[p_id] = None

def _get_max_mesage_size(self):
def _get_max_message_size(self):
# type: () -> None
# pylint: disable=protected-access,line-too-long
with self._lock:
Expand Down Expand Up @@ -350,7 +350,7 @@ def create_batch(self, **kwargs):

"""
if not self._max_message_size_on_link:
self._get_max_mesage_size()
self._get_max_message_size()

max_size_in_bytes = kwargs.get("max_size_in_bytes", None)
partition_id = kwargs.get("partition_id", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(

self._auth = auth
self._encoding = 'UTF-8'
self._auth_timeout = kwargs.pop('auth_timeout', DEFAULT_AUTH_TIMEOUT)
self._auth_timeout = kwargs.get('auth_timeout')
self._token_put_time = None
self._expires_on = None
self._token = None
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from ..constants import (
INCOMING_WINDOW,
OUTGOING_WIDNOW,
OUTGOING_WINDOW,
ConnectionState,
SessionState,
SessionTransferState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(

self._auth = auth
self._encoding = 'UTF-8'
self._auth_timeout = kwargs.pop('auth_timeout', DEFAULT_AUTH_TIMEOUT)
self._auth_timeout = kwargs.get('auth_timeout')
self._token_put_time = None
self._expires_on = None
self._token = None
Expand Down
284 changes: 120 additions & 164 deletions sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
MAX_FRAME_SIZE_BYTES = 1024 * 1024
MAX_CHANNELS = 65535
INCOMING_WINDOW = 64 * 1024
OUTGOING_WIDNOW = 64 * 1024
OUTGOING_WINDOW = 64 * 1024
Copy link
Member

Choose a reason for hiding this comment

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

hah! nice catch


DEFAULT_LINK_CREDIT = 10000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from .constants import (
INCOMING_WINDOW,
OUTGOING_WIDNOW,
OUTGOING_WINDOW,
ConnectionState,
SessionState,
SessionTransferState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async def _get_partitions(self) -> None:
for p_id in cast(List[str], self._partition_ids):
self._producers[p_id] = None

async def _get_max_mesage_size(self) -> None:
async def _get_max_message_size(self) -> None:
# pylint: disable=protected-access,line-too-long
async with self._lock:
if not self._max_message_size_on_link:
Expand Down Expand Up @@ -378,7 +378,7 @@ async def create_batch(

"""
if not self._max_message_size_on_link:
await self._get_max_mesage_size()
await self._get_max_message_size()

if max_size_in_bytes and max_size_in_bytes > self._max_message_size_on_link:
raise ValueError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_send_client_creation():
sender = SendClient(
"fake.host.com",
"fake_eh",
"my_fake_auth"
auth="my_fake_auth"
)
assert sender.target == "fake_eh"
assert sender._auth == "my_fake_auth"
Expand All @@ -22,7 +22,7 @@ def test_receive_client_creation():
receiver = ReceiveClient(
"fake.host.com",
"fake_eh",
"my_fake_auth"
auth="my_fake_auth"
)
assert receiver.source == "fake_eh"
assert receiver._auth == "my_fake_auth"