Skip to content

Commit 6190bde

Browse files
authored
[EG] update pyproject and samples (#35857)
* update * pylint changes
1 parent 6e4a87f commit 6190bde

File tree

6 files changed

+14
-34
lines changed

6 files changed

+14
-34
lines changed

scripts/devops_tasks/test_run_samples.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,6 @@
9393
"consume_eventgrid_events_from_service_bus_queue.py",
9494
"sample_publish_events_to_a_topic_using_sas_credential.py",
9595
"sample_publish_events_to_a_topic_using_sas_credential_async.py",
96-
'sample_publish_operation.py',
97-
'sample_receive_operation.py',
98-
'sample_reject_operation.py',
99-
'sample_eg_client_authentication.py',
100-
'sample_all_operations.py',
101-
'sample_release_operation.py',
102-
'sample_acknowledge_operation.py',
103-
'sample_publish_operation_async.py',
104-
'sample_release_operation_async.py',
105-
'sample_reject_operation_async.py',
106-
'sample_acknowledge_operation_async.py',
107-
'sample_receive_operation_async.py',
108-
'sample_all_operations_async.py'
10996
],
11097
"azure-eventhub": [
11198
"client_identity_authentication.py", # TODO: remove after fixing issue #29177

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_operations/_patch.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
Optional,
1717
TypeVar,
1818
Union,
19-
overload,
2019
TYPE_CHECKING,
2120
)
2221

@@ -28,7 +27,6 @@
2827
from azure.core.tracing.decorator import distributed_trace
2928
from azure.core.pipeline import PipelineResponse
3029
from azure.core.rest import HttpRequest, HttpResponse
31-
from azure.core.utils import case_insensitive_dict
3230

3331
from ._operations import (
3432
EventGridPublisherClientOperationsMixin as PublisherOperationsMixin,
@@ -105,8 +103,6 @@ def send(
105103
) -> None: # pylint: disable=docstring-should-be-keyword, docstring-missing-param
106104
"""Send events to the Event Grid Service.
107105
108-
:param topic_name: The name of the topic to send the event to.
109-
:type topic_name: str
110106
:param events: The event to send.
111107
:type events: CloudEvent or List[CloudEvent] or Dict[str, Any] or List[Dict[str, Any]]
112108
or CNCFCloudEvent or List[CNCFCloudEvent] or EventGridEvent or List[EventGridEvent]
@@ -143,24 +139,24 @@ def send(
143139
# Try to send via namespace
144140
self._publish(self._namespace, _serialize_events(events), **kwargs)
145141
except Exception as exception: # pylint: disable=broad-except
146-
self._http_response_error_handler(exception, "Namespaces")
142+
self._http_response_error_handler(exception)
147143
raise exception
148144
else:
149145
kwargs["content_type"] = content_type if content_type else "application/json; charset=utf-8"
150146
try:
151147
self._publish(events, channel_name=channel_name, **kwargs)
152148
except Exception as exception:
153-
self._http_response_error_handler(exception, "Basic")
149+
self._http_response_error_handler(exception)
154150
raise exception
155151

156-
def _http_response_error_handler(self, exception, level):
152+
def _http_response_error_handler(self, exception):
157153
if isinstance(exception, HttpResponseError):
158154
if exception.status_code == 400:
159155
raise HttpResponseError("Invalid event data. Please check the data and try again.") from exception
160156
if exception.status_code == 404:
161157
raise ResourceNotFoundError(
162158
"Resource not found. "
163-
f"Please check that the tier you are using, corresponds to the correct "
159+
"Please check that the tier you are using, corresponds to the correct "
164160
"endpoint and/or topic name."
165161
) from exception
166162
raise exception

sdk/eventgrid/azure-eventgrid/azure/eventgrid/_patch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def __init__(
132132
)
133133

134134
def __repr__(self) -> str:
135-
return f"<EventGridConsumerClient: namespace_topic={self._namespace}, subscription={self._subscription}, credential type={type(self._credential)}>"
135+
return f"<EventGridConsumerClient: namespace_topic={self._namespace}, \
136+
subscription={self._subscription}, credential type={type(self._credential)}>"
136137

137138

138139
def patch_sdk():

sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_operations/_patch.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from azure.core.pipeline import PipelineResponse
1717
from azure.core.rest import HttpRequest, AsyncHttpResponse
1818
from ...models._patch import ReceiveDetails
19-
from ..._operations._patch import use_standard_only
2019
from ._operations import (
2120
EventGridPublisherClientOperationsMixin as PublisherOperationsMixin,
2221
EventGridConsumerClientOperationsMixin as ConsumerOperationsMixin,
@@ -29,7 +28,7 @@
2928
)
3029

3130
from ..._legacy import EventGridEvent
32-
from ..._legacy._helpers import _is_eventgrid_event_format, _from_cncf_events
31+
from ..._legacy._helpers import _is_eventgrid_event_format
3332

3433
if sys.version_info >= (3, 9):
3534
from collections.abc import MutableMapping
@@ -65,8 +64,6 @@ async def send(
6564
) -> None: # pylint: disable=docstring-should-be-keyword, docstring-missing-param
6665
"""Send events to the Event Grid Service.
6766
68-
:param topic_name: The name of the topic to send the event to.
69-
:type topic_name: str
7067
:param events: The event to send.
7168
:type events: CloudEvent or List[CloudEvent] or Dict[str, Any] or List[Dict[str, Any]]
7269
or CNCFCloudEvent or List[CNCFCloudEvent] or EventGridEvent or List[EventGridEvent]
@@ -104,24 +101,24 @@ async def send(
104101
# Try to send via namespace
105102
await self._publish(self._namespace, _serialize_events(events), **kwargs)
106103
except Exception as exception: # pylint: disable=broad-except
107-
self._http_response_error_handler(exception, "Namespaces")
104+
self._http_response_error_handler(exception)
108105
raise exception
109106
else:
110107
kwargs["content_type"] = content_type if content_type else "application/json; charset=utf-8"
111108
try:
112109
await self._publish(events, channel_name=channel_name, **kwargs)
113110
except Exception as exception:
114-
self._http_response_error_handler(exception, "Basic")
111+
self._http_response_error_handler(exception)
115112
raise exception
116113

117-
def _http_response_error_handler(self, exception, level):
114+
def _http_response_error_handler(self, exception):
118115
if isinstance(exception, HttpResponseError):
119116
if exception.status_code == 400:
120117
raise HttpResponseError("Invalid event data. Please check the data and try again.") from exception
121118
if exception.status_code == 404:
122119
raise ResourceNotFoundError(
123120
"Resource not found. "
124-
f"Please check that the tier you are using, corresponds to the correct "
121+
"Please check that the tier you are using, corresponds to the correct "
125122
"endpoint and/or topic name."
126123
) from exception
127124
raise exception

sdk/eventgrid/azure-eventgrid/azure/eventgrid/aio/_patch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def __init__(
130130
)
131131

132132
def __repr__(self) -> str:
133-
return f"<EventGridConsumerClient: namespace_topic={self._namespace}, subscription={self._subscription}, credential type={type(self._credential)}>"
133+
return f"<EventGridConsumerClient: namespace_topic={self._namespace}, \
134+
subscription={self._subscription}, credential type={type(self._credential)}>"
134135

135136

136137
def patch_sdk():
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
[tool.azure-sdk-build]
22
pyright = false
3-
verifytypes = false
4-
strict_sphinx = false
5-
pylint = false
3+
verifytypes = false

0 commit comments

Comments
 (0)