Skip to content

Commit 8a9178e

Browse files
authored
Release notes for 0.21.0 (#210)
1 parent a9d5bff commit 8a9178e

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

CHANGES.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Changes
22
=======
33

4-
Unreleased
5-
----------
4+
0.21.0 (2024-07-02)
5+
-------------------
66

7-
* The precedence of session param settings, request metadata keys and session
8-
config override methods has changed.
7+
* **Backward-incompatible change:** The precedence of session param settings,
8+
request metadata keys and session config override methods has changed.
99

1010
Before, priority from higher to lower was:
1111

@@ -35,6 +35,19 @@ Unreleased
3535

3636
#. :meth:`~scrapy_zyte_api.SessionConfig.params`
3737

38+
* When using the :reqmeta:`zyte_api_session_params` or
39+
:reqmeta:`zyte_api_session_location` request metadata keys, a different pool
40+
ID is now generated by default based on their value. See
41+
:meth:`~scrapy_zyte_api.SessionConfig.pool` for details.
42+
43+
* The new :reqmeta:`zyte_api_session_pool` request metadata key allows
44+
overriding the pool ID of a request.
45+
46+
* Added :ref:`pool management documentation <session-pools>`.
47+
48+
* Fixed some documentation examples where the parameters of the ``check``
49+
method of :setting:`ZYTE_API_SESSION_CHECKER` were in reverse order.
50+
3851

3952
0.20.0 (2024-06-26)
4053
-------------------

scrapy_zyte_api/_session.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,20 +276,20 @@ def location(self, request: Request) -> Dict[str, str]:
276276
keys as described in :ref:`session-init`.
277277
278278
When overriding this method, you should only return a custom value if
279-
the default implementation returns an empty :class:`dict`, to avoid
280-
breaking the :ref:`precedence chain that users expect <session-init>`,
281-
e.g.
279+
the default implementation returns an empty :class:`dict`, e.g.
282280
283281
.. code-block:: python
284282
285283
def location(self, request: Request) -> Dict[str, str]:
286284
fallback = {"addressCountry": "US", "addressRegion": "NY", "postalCode": "10001"}
287285
return super().location(request) or fallback
288286
289-
.. note:: An implementation of :meth:`~scrapy_zyte_api.SessionConfig.location`
290-
can technically override :reqmeta:`zyte_api_session_location` or
291-
:setting:`ZYTE_API_SESSION_LOCATION`, but it is not recommended as it
292-
breaks the precedence chain above that users may expect.
287+
.. note:: An implementation of
288+
:meth:`~scrapy_zyte_api.SessionConfig.location` can technically
289+
override :reqmeta:`zyte_api_session_location` or
290+
:setting:`ZYTE_API_SESSION_LOCATION`, but it is not recommended as
291+
it breaks the :ref:`precedence chain that users expect
292+
<session-init>`.
293293
294294
You should only override this method if you need a location to be
295295
used even when no location is specified through request metadata or

0 commit comments

Comments
 (0)