Skip to content

Commit 923f2b6

Browse files
authored
Remove some noqas thanks to new Ruff release (#172)
1 parent ed5b9f5 commit 923f2b6

File tree

14 files changed

+19
-15
lines changed

14 files changed

+19
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [1.5.2](../../releases/tag/v1.5.2) - Unreleased
44

5+
### Internal changes
6+
7+
- Remove some noqas thanks to the new Ruff release
8+
59
### Fixed
610

711
- Add missing import check to `ApifyHttpProxyMiddleware`
@@ -11,7 +15,7 @@
1115
### Internal changes
1216

1317
- Allowed running integration tests from PRs from forks, after maintainer approval
14-
- Do not close `nested_event_loop` in the `Scheduler.__del__`.
18+
- Do not close `nested_event_loop` in the `Scheduler.__del__`
1519

1620
## [1.5.0](../../releases/tag/v1.5.0) - 2024-01-03
1721

src/apify/_memory_storage/resource_clients/base_resource_collection_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _get_resource_client_class(self: BaseResourceCollectionClient) -> type[Resou
4343
raise NotImplementedError('You must override this method in the subclass!')
4444

4545
@abstractmethod
46-
async def list(self: BaseResourceCollectionClient) -> ListPage: # noqa: A003
46+
async def list(self: BaseResourceCollectionClient) -> ListPage:
4747
"""List the available storages.
4848
4949
Returns:

src/apify/_memory_storage/resource_clients/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ async def push_items(self: DatasetClient, items: JSONSerializable) -> None:
314314
existing_dataset_by_id._dataset_entries[idx] = entry
315315
added_ids.append(idx)
316316

317-
data_entries = [(id, existing_dataset_by_id._dataset_entries[id]) for id in added_ids] # noqa: A001
317+
data_entries = [(id, existing_dataset_by_id._dataset_entries[id]) for id in added_ids] # noqa: A001
318318

319319
async with existing_dataset_by_id._file_operation_lock:
320320
await existing_dataset_by_id._update_timestamps(has_been_modified=True)

src/apify/_memory_storage/resource_clients/dataset_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _get_storage_client_cache(self: DatasetCollectionClient) -> list[DatasetClie
2121
def _get_resource_client_class(self: DatasetCollectionClient) -> type[DatasetClient]:
2222
return DatasetClient
2323

24-
async def list(self: DatasetCollectionClient) -> ListPage: # noqa: A003
24+
async def list(self: DatasetCollectionClient) -> ListPage:
2525
"""List the available datasets.
2626
2727
Returns:

src/apify/_memory_storage/resource_clients/key_value_store_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _get_storage_client_cache(self: KeyValueStoreCollectionClient) -> list[KeyVa
2121
def _get_resource_client_class(self: KeyValueStoreCollectionClient) -> type[KeyValueStoreClient]:
2222
return KeyValueStoreClient
2323

24-
async def list(self: KeyValueStoreCollectionClient) -> ListPage: # noqa: A003
24+
async def list(self: KeyValueStoreCollectionClient) -> ListPage:
2525
"""List the available key-value stores.
2626
2727
Returns:

src/apify/_memory_storage/resource_clients/request_queue_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _get_storage_client_cache(self: RequestQueueCollectionClient) -> list[Reques
2121
def _get_resource_client_class(self: RequestQueueCollectionClient) -> type[RequestQueueClient]:
2222
return RequestQueueClient
2323

24-
async def list(self: RequestQueueCollectionClient) -> ListPage: # noqa: A003
24+
async def list(self: RequestQueueCollectionClient) -> ListPage:
2525
"""List the available request queues.
2626
2727
Returns:

src/apify/actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ async def _cancel_event_emitting_intervals(self: Actor) -> None:
295295
await self._send_system_info_interval_task
296296

297297
@classmethod
298-
async def exit( # noqa: A003
298+
async def exit(
299299
cls: type[Actor],
300300
*,
301301
exit_code: int = 0,

src/apify/event_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ async def _process_platform_messages(self: EventManager) -> None:
219219
try:
220220
async with websockets.client.connect(self._config.actor_events_ws_url) as websocket:
221221
self._platform_events_websocket = websocket
222-
self._connected_to_platform_websocket.set_result(True) # noqa: FBT003
222+
self._connected_to_platform_websocket.set_result(True)
223223
async for message in websocket:
224224
try:
225225
parsed_message = json.loads(message)
@@ -234,4 +234,4 @@ async def _process_platform_messages(self: EventManager) -> None:
234234
logger.exception('Cannot parse actor event', extra={'message': message})
235235
except Exception:
236236
logger.exception('Error in websocket connection')
237-
self._connected_to_platform_websocket.set_result(False) # noqa: FBT003
237+
self._connected_to_platform_websocket.set_result(False)

src/apify/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _get_extra_fields(self: ActorLogFormatter, record: logging.LogRecord) -> dic
8282
return extra_fields
8383

8484
@ignore_docs
85-
def format(self: ActorLogFormatter, record: logging.LogRecord) -> str: # noqa: A003
85+
def format(self: ActorLogFormatter, record: logging.LogRecord) -> str:
8686
"""Format the log record nicely.
8787
8888
This formats the log record so that it:

src/apify/scrapy/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self: ApifyScheduler) -> None:
3535
self._rq: RequestQueue | None = None
3636
self.spider: Spider | None = None
3737

38-
def open(self: ApifyScheduler, spider: Spider) -> None: # noqa: A003 # this has to be named "open"
38+
def open(self: ApifyScheduler, spider: Spider) -> None: # this has to be named "open"
3939
"""Open the scheduler.
4040
4141
Args:

0 commit comments

Comments
 (0)