Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 1 addition & 4 deletions docs/03_concepts/code/03_rq.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ async def main() -> None:

# If you try to add an existing request again, it will not do anything
add_request_info = await queue.add_request(
Request.from_url('http://different-example.com/5')
Request.from_url('http://example.com/5')
)
Actor.log.info(f'Add request info: {add_request_info}')

processed_request = await queue.get_request(add_request_info.id)
Actor.log.info(f'Processed request: {processed_request}')

# Finally, process the queue until all requests are handled
while not await queue.is_finished():
# Fetch the next unhandled request in the queue
Expand Down
4 changes: 2 additions & 2 deletions docs/04_upgrading/upgrading_to_v3.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: upgrading-to-v2
title: Upgrading to v2
id: upgrading-to-v3
title: Upgrading to v3
---

This page summarizes the breaking changes between Apify Python SDK v2.x and v3.0.
Expand Down
3 changes: 1 addition & 2 deletions src/apify/scrapy/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def to_scrapy_request(apify_request: ApifyRequest, spider: Spider) -> ScrapyRequ

# Update the meta field with the meta field from the apify_request
meta = scrapy_request.meta or {}
meta.update({'apify_request_id': apify_request.id, 'apify_request_unique_key': apify_request.unique_key})
meta.update({'apify_request_unique_key': apify_request.unique_key})
# scrapy_request.meta is a property, so we have to set it like this
scrapy_request._meta = meta # noqa: SLF001

Expand All @@ -134,7 +134,6 @@ def to_scrapy_request(apify_request: ApifyRequest, spider: Spider) -> ScrapyRequ
url=apify_request.url,
method=apify_request.method,
meta={
'apify_request_id': apify_request.id,
'apify_request_unique_key': apify_request.unique_key,
},
)
Expand Down
4 changes: 2 additions & 2 deletions src/apify/storage_clients/_apify/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class CachedRequest(BaseModel):
Only internal structure.
"""

id: str
"""The ID of the request."""
unique_key: str
"""Unique key of the request."""

was_already_handled: bool
"""Whether the request was already handled."""
Expand Down
Loading
Loading