Skip to content

Latest commit

 

History

History
123 lines (111 loc) · 8.37 KB

CHANGELOG.md

File metadata and controls

123 lines (111 loc) · 8.37 KB

Changelog

This file records the changes that a user of pygridgain can see: new API, changed behaviour, and fixed defects. Internal work appears here only when it changes what the client does.

The format follows Keep a Changelog.

Unreleased

Added

  • The client ships a PEP 561 py.typed marker.
  • Cache.vector() and AioCache.vector() take field_filter and oversample. field_filter maps field names to values. The engine applies it before it chooses the k nearest, so a filtered query no longer comes back short the way a filter applied after the query does. The filter is a conjunction of exact-value tests on fields of the type's text index; the server refuses a field that is not indexed. The client checks the filter before it sends anything and raises ValueError for an empty field name, a None value, or a value that is not a str, int, float, bool, Decimal, UUID, datetime, date or a (datetime, nanos) tuple. The server compares text forms, so a value must match the Java type of the stored field: a datetime or date matches a java.util.Date field, and a java.sql.Timestamp field needs the (datetime, nanos) Timestamp form. Both parameters need a cluster with the QUERY_VECTOR_PARAMS feature. Against an older cluster, a filter or a nonzero oversample raises NotSupportedByClusterError; the client does not drop the filter. A query without them sends the same request as before. (GG-51945)

Changed

  • The client now needs Python 3.11 or newer, and supports Python 3.11 to 3.15. Python 3.9 has reached its end of life, and 3.10 reaches it in October 2026. Wheels are built for 3.11 to 3.15. The metadata said 3.7 before, so pip now refuses to install the client on an older interpreter instead of installing it where it was never tested. (GG-51637)

  • SSL connections use TLS 1.3 by default. Before, the default was TLS 1.2 only. Now it is TLS 1.3 or newer, so the client cannot connect to a server that supports only TLS 1.2 unless you pass ssl_version=ssl.TLSVersion.TLSv1_2. ssl_version now takes an ssl.TLSVersion, which is the minimum version. The ssl.PROTOCOL_* constants still work and select the same versions as before: pass ssl_version=ssl.PROTOCOL_TLSv1_2 to keep TLS 1.2 only. Other values, such as ssl.PROTOCOL_TLS_SERVER, raise ParameterError on connect. SSL_DEFAULT_VERSION is now ssl.TLSVersion.TLSv1_3. ssl_ciphers does not apply to TLS 1.3. The client still does not check the server host name. This is a public API behaviour change. (GG-51637)

  • The installed package no longer contains a top-level tests package. The wheel put the client's tests into site-packages/tests, where they clashed with any other project that ships a tests package. Only pygridgain is installed now. The source distribution still contains the tests.

  • The client no longer pins exact versions of its dependencies, and no longer needs contextvars. attrs and tzlocal were pinned with ==, so the client could not be installed together with an application that needed another version. They are now minimum versions (attrs>=23.2.0, tzlocal>=4.3.1). contextvars has been in the standard library since Python 3.7, so the backport only added immutables for nothing.

  • The package metadata moved from setup.py to pyproject.toml, and the license now uses the PEP 639 fields instead of the deprecated license classifier. setup.py still builds the C extension. Building from a source distribution now needs setuptools 77 or newer, which pip installs on its own.

  • Cache.vector() and AioCache.vector() now use k as the default page_size (before: 1). A vector query returns at most k rows, so the whole result now arrives in one page. The old default made one server round trip for every result row: a k=10 query used 20 socket reads, and now it uses 2. This is a public API behaviour change. Pass page_size explicitly to keep a smaller page. (GG-49932)

  • Cache.vector() and AioCache.vector() reject a non-positive k with ValueError. Before, the client sent the request and the server refused it. The server keeps the upper bound, because GRIDGAIN_VECTOR_MAX_K is configurable there. (GG-49932)

  • Response parsing shares one ctypes class for each distinct structure shape, instead of building a new class for every element of every row. Vector queries that carry values are 20% to 28% faster, and the client keeps no dead classes. There is no API change. (GG-49932)

  • Vector query responses decode in one pass, directly from the response buffer. The vector cursors no longer unwrap each value a second time. Queries that carry values are a further 18% faster at k=100; rows are unchanged. Two response shapes change at the edges:

    • An asyncio legacy (key, value) row is now a tuple. Before, it was a list. The synchronous client always returned a tuple, so the two clients now agree.
    • pygridgain.api.sql.vector() returns legacy rows as a list of (key, value) tuples. Before, it returned a dictionary. The wire order stays the same, and the cursor gives the same rows as before. This function is low-level; Cache.vector() is unchanged.

    (GG-49932)

Removed

  • The empty pygridgain.stream.aio_cluster module. It was an accidental copy of pygridgain.aio_cluster, left empty instead of deleted. Nothing imported it, and pygridgain.aio_cluster itself is not affected. (GG-51636)

Fixed

  • The client no longer emits DeprecationWarning on Python 3.14 and newer. The ctypes structures of the binary protocol now set _layout_ = 'ms'; without it, Python 3.19 is going to reject them. The layout on the wire does not change. The client also no longer calls asyncio.iscoroutinefunction, which is deprecated in 3.14, and no longer creates SSL contexts with a deprecated ssl.PROTOCOL_* constant. (GG-51637)
  • A partition-aware client now registers the binary type of a complex key. Picking the node for a key serializes it and keeps the bytes on the object, and the request was then written from those bytes, which skipped the type registration that ordinary serialization does. The cluster stored the entry under a type ID whose fields it had never been told, so SQL and other clients could not read the key back. AioClient is partition-aware by default, so this affected asyncio code even when it did not ask for partition awareness. (GG-38200)
  • A string that contains a NUL character (U+0000) is no longer truncated. The string codec used a ctypes c_char array, which stops at the first NUL. The client cut such a string on read and on write, so 'a\x00b' went to the server as 'a' and came back as 'a'. This applies to every string the client sends or receives, not only to vector queries. (GG-49932)
  • The installation instructions no longer send users to the GridGain 9 client. The pygridgain name on PyPI also carries the GridGain 9 client, which is versioned from 9.0 upwards, so a plain pip install pygridgain resolves to that instead of to this client. The README and the documentation now use pip install "pygridgain<9". (GG-51636)
  • The client now reports its own time zone to the server. The client.timezone handshake attribute was None for every zone that uses DST, so the server kept its own default zone and shifted every timestamp of the connection by the difference between the two. The client now sends the IANA zone ID (Europe/Berlin), like the other thin clients, and sends nothing when the machine names no zone. Versions 1.5.0 and 1.6.0 are affected: the tzlocal update in 1.5.0 changed what tzname(None) returns. (GG-51543)