Releases: datastax/astrapy
Release v1.5.2
v1.5.2
Bugfix: Database.get_collection
uses callers inheritance (same for async)
Release v1.5.1
v. 1.5.1
Switching to endpoint as the only/primary way of specifying databases:
AstraDBClient
tolerates (deprecated, removal in 2.0) id[/region] inget_database
- (internal-use constructors and utilities only accept API Endpoint)
AstraDBAdmin
is the only place where id[/region] will remain an allowed path in 2.0- all tests adapted to reflect this simplification
Admins: resilience against DevOps responses omitting 'keyspace'/'keyspaces'
AstraDBAdmin
: added filters and automatic pagination to [async_]list_databases
Consistent handling of deletedCount=-1
from the API (always returned as-is)
Cursors: alignment and rework:
- states are an enum; state names reworked for clarity (better cursor
__repr__
) _copy
and_to_sync
methods always return a clean pristine cursor- "retrieved" property deprecated (removal 2.0). Use
consumed
. - "collection" property deprecated (removal 2.0). Use
data_source
.
Deprecation of all set_caller
(=> to be set at constructor-time) (removal in 2.0)
Callers and user-agent string:
-
remove RAGStack automatic detection
-
Deprecate "caller_name/caller_version" parameters in favour of
callers
pair list -
(minor) breaking change: passing only one of "caller_name/caller_version" to
_copy
/with_options
will override the whole one-item
callers pair list
Repo housekeeping: -
using ruff for imports and formatting (instead of isort+black) by @cbornet
-
add ruff rules UP(pyupgrade) by @cbornet
-
remove
cassio
unused dependency
Release v1.5.0
v. 1.5.0
Deprecation of "namespace-" terminology, replaced by "keyspace-" (removal in 2.0)
- deprecation of all namespace method names
- deprecation of the
namespace=
named argument to all methods - deprecation of the
update_db_namespace
parameter to create_*space
Deprecation of collection bulk_write method (removal in 2.0)
APICommander logs warnings received from the Data API
Full removal of "core library" from the current API:
- DevOps API accessed through APICommander everywhere
- Admin objects use APICommander consistently
- [Async]Database and [Async]Collection directly use APICommander
- Cursor library uses APICommander directly
- Core library imports triggers a submodule-wide deprecation warning
- (simplification of the vector/vectorize deprecator utility)
Widened exception hierarchy with:
- DevOpsAPIHttpException
- DevOpsAPITimeoutException
- DevOpsAPIFaultyResponseException
Rearrangement into separate modules for:
- constants, strings, magic numbers and settings
- request low-level tools
- payload/response transformations
- (sometimes with temporary duplication to avoid depending on 'core')
Testing:
- testing on HCD targets Data API v 1.0.16
- added tests for APICommander
- improved tests for admin classes
Logging of API requests made more uniform and easier to read
Replaced collections.abc.Iterator => typing.Iterator for python3.8 compatibility
Release v1.4.2
v. 1.4.2
Method 'update_one' of [Async]Collection: now invokes the corresponding API command.
Better URL-parsing error messages for the API endpoint (with guidance on expected format)
Improved __repr__
for: token/auth-related items, Database/Client classes, response+info objects
DataAPIErrorDescriptor can parse 'extend error' in the responses
Introduced DataAPIHttpException (subclass of both httpx.HTTPStatusError and DataAPIException)
testing on HCD:
- DockerCompose tweaked to invoke
docker compose
- HCD 1.0.0 and Data API 1.0.15 as test targets
relaxed dependency on "uuid6" to most recent releases
core:
- prefetched find iterators: fix second-thread hangups in some cases (by @cbornet)
- added 'options' parameter to [Async]AstraDBCollection.update_one
Release v1.4.1
v. 1.4.1
FindEmbeddingProvidersResult and descendant dataclasses:
- add handling of optional 'hint' and 'displayName' fields for parameters
- knowedge of optional-as-null vs optional-as-possibly-absent ancillary fields
Replace bson dependency with pymongo (#297, by @caseyclements)
Release v1.4.0
DatabaseAdmin classes retain a reference to the Async/Database instance that spawned it, if any
- introduced a spawner_database parameter to database admin constructors
- database admin can retroactively set the db's working namespace upon creation of same
- Idiom
database = client.get_database(...); database.get_database_admin().create_namespace("the_namespace", update_db_namespace=True)
Database (and AsyncDatabase) classes admit null namespace:
- default to "default_namespace" only for Astra, otherwise null
- as long as null, most operations are unavailable and error out
- a
use_namespace
method to (mutably) set the working namespace on a database instance
AstraDBDatabaseAdmin class is fully region-aware:
- can be instantiated with an endpoint (also
id
parameter aliased toapi_endpoint
) - requires a region to be specified with an ID, unless auto-guess can be done
VectorizeOps: support for find_embedding_providers Database method
Support for multiple-header embedding api keys:
EmbeddingHeadersProvider
classes forembedding_api_key
parameter- AWS header provider in addition to the regular one-header one
- adapt CI to cover this setup
Testing:
- restructure CI to fully support HCD alongside Astra DB
- add details for testing new embedding providers
Release v1.3.1
- Fixed bug in parsing endpoint domain names containing hyphens (#287), by @bradfordcp
- Added isort for source code formatting
- Updated abstractions diagram in README for non-Astra environments
Release v1.3.0
- Integration testing covers Astra and nonAstra smoothly:
* idiomatic library
* vectorize_idiomatic
* nonAstra admin, i.e. namespace crud - Add the
TokenProvider
abstract class => andStaticTokenProvider
,UsernamePasswordTokenProvider
- Introduce CHANGES file.
- Add
__eq__
and_copy
methods toAPICommander
class - Allow
delete_many({})
with empty filter - Implement
include_sort_vector
option toCollection.find
andget_sort_vector
to cursors - Add Content-Type header to all API requests
- Added HCD and CASSANDRA Environment values (besides the other non-Astra DSE and OTHER)
- Clearer string repr of cursors ('retrieved' => 'yielded so far')
- Deprecation of collection
delete_all
method in favour ofdelete_many(filter={})
* Introduction of a custom deprecation decorator for async method removal tests - Deprecation of vector,vectors and vectorize params from collections and Operations
- Remove several long-deprecated methods from core API (i.e. internal changes):
AstraDBCollection.delete
=>delete_one
AstraDBCollection.upsert
=>upsert_one
AsyncAstraDBCollection.upsert
=>upsert_one
AstraDB.truncate_collection
=>AstraDBCollection.clear
AsyncAstraDB.truncate_collection
=>AsyncAstraDBCollectionclear
- Add support for null tokens in the core library
Release v1.2.1
Raise default chunk size for insert_many to 50
Improvements in docstrings, testing, support for latest responses from vectorize.
Release v1.2.0
Vectorize support and non-Astra environment management.
Non-Astra environment awareness:
- astrapy.constants.Environment enum for the "environment" parameter to client, etc
- flexibility and adaptive defaults for data api url
- environment knowledge trickles throughout all classes (client, admins, databases)
- DataAPIDatabaseAdmin class (i.e. for namespace CRUD)
(internal) astrapy.api_commander.APICommander
(internal) astrapy.api_options.{BaseAPIOptions, CollectionAPIOptions}
$vectorize support:
- "service options" for creating/retrieving collections, covering $vectorize needs
- embedding_api_key parameter to collection (for "header" usage)
collection-level timeout parameter (overridable in single method calls)
expand "projection" type to include slice projections
client.get_database can accept an API endpoint directly
insert_many and bulk_write default to ordered=False