Skip to content

Commit

Permalink
Toward 1.4.0 (findEmbeddingProviders; HCD namespace idioms; region/en…
Browse files Browse the repository at this point in the history
…dpoint in DatabaseAdmin) (#293)

* WIP structures and nonastra impl. docstrings + tests todo

* rename list_EPs -> find_EPs; add warning for extra dict keys in parsing fEPs

* __repr__ for findEmbeddingProviders dataclasses

* simplified region autoguess; database holds api_endpoint property

* id -> id-or-endpoint throughout admin classes; admin classes fully region-aware

* admin fully endpoint- and region-aware, all tests passing

* docstrings to all info.py findEPs objects

* AstraDBDatabaseAdmin supports findEmbeddingProviders

* add annotations import throughout

* int. testing uses the datatabase admin to fetch providers

* named alias 'api_endpoint' for 'id' in user-facing  admin methods

* core tests respect the asyncio.gather in insert_many failure mode test

* aws header provider gets better __repr__

* rename StaticEmbeddingHeadersProvider -> DefaultEmbeddingHeadersProvider

* rename DefaultEmbeddingHeadersProvider -> EmbeddingAPIKeyHeadersProvider

* Database supports optional namespace, with guards; rename EmbeddingAPIKeyHeadersProvider->EmbeddingAPIKeyHeaderProvider

* managing set_caller and Database members; added tests for all optional-namespace entrypoints

* use_namespace method for Async/Database

* DatabaseAdmin classes manage their spawner_database attribute, with tests

* update_db_namespace flag in database admin's create_namespace methods + tests

* heading to 1.4.0; find_embedding_providers returns a top-level object with the provider map as its member

* fix find_emb_pr docstring; adjust nonastra admin tests to manage async fixtures

* bump to 1.4.0
  • Loading branch information
hemidactylus authored Jul 9, 2024
1 parent 2adce1a commit a4885a4
Show file tree
Hide file tree
Showing 80 changed files with 2,266 additions and 467 deletions.
17 changes: 16 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
(master)
v. 1.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 to `api_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 for `embedding_api_key` parameter
- AWS header provider in addition to the regular one-header one
Expand All @@ -8,12 +20,14 @@ Testing:
- restructure CI to fully support HCD alongside Astra DB
- add details for testing new embedding providers


v. 1.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


v. 1.3.0
========
Integration testing covers Astra and nonAstra smoothly:
Expand All @@ -39,6 +53,7 @@ Remove several long-deprecated methods from **core API** (i.e. internal changes)
AsyncAstraDB.truncate_collection => AsyncAstraDBCollectionclear
Add support for null tokens in the core library


v. 1.2.1
========
Raise default chunk size for insert_many to 50
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ from astrapy.info import (
CollectionVectorOptions,
CollectionOptions,
CollectionDescriptor,
EmbeddingProviderParameter,
EmbeddingProviderModel,
EmbeddingProviderToken,
EmbeddingProviderAuthentication,
EmbeddingProvider,
FindEmbeddingProvidersResult,
)
```

Expand Down
2 changes: 2 additions & 0 deletions astrapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import importlib.metadata
import os

Expand Down
Loading

0 comments on commit a4885a4

Please sign in to comment.