Skip to content

Tags: datastax/astrapy

Tags

v2.0.0rc1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump to 2.0.0rc1 for (pre-)release (#332)

bump to 2.0.0rc1 for (pre-)release

v2.0.0-preview

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Astrapy 2.0.0-preview: Tables and much more (#326)

* WIP on tables, descriptor refactor, dse compose

* database table methods: list/listnames sync+async done

* first table (unit) tests

* covering vector types in table defs

* wip on tolerant parse/coerce of table options

* table crd in place

* table info structures handle unsupported columns

* just introduced scalar-type enum

* check for ok:1 in all database class table/coll CD ops

* table index descriptor classes

* create (regular/vector) index; drop index

* better, shorter, privacy-oriented repr for Full/APIOptions/db classes

* more streamlined and secure hiding of tokens in repr and such

* repr for apicommander

* add support for sourceModel in vector index options

* add items to the cql type enum

* most table vanity methods

* finished table vanity methods; started refactor exceptions

* binary is handled at the payload coded layer

* removed the pointless {ok:1} returns

* remove check_exists and CollectionAlreadyExistsException

* rationalize table test dir; some table DML+testing

* fix timeout s-vs-ms bugs, simplify timeout internal management, unflaky timeout tests

* collection find_one uses API findOne command

* WIP table generics

* wip generics of collection

* tiny edit

* brought typing in all tests; add 1/4 typing-specific test

* add test for typing collections+tables

* rename the default Row and Document types

* started cursor2

* cursor2 rewritten and wired to collection find. distinct todo

* distinct+in cursors for collections + test/ruff

* refine cursor timeouts and replace CursorIsStartedException -> CursorException

* for_each, map (also rename overall_max_time_ms -> overall_timeout_ms)

* test of timeouts in cursor 'reduce' operations

* add typing test for map, etc

* table cursors, table's find and distinct methods

* improve class hierarchy for table column descriptors

* table converters, core logic and most converters

* TableSet class and its usage

* TableMap and its usage

* apitimestamp class, loss/y api optins known to payload conv, support in collections read/write

* TableDuration type and its wiring

* use stdlib ipaddress for 'inet' CQL type

* TableDate class and its use in converters

* TableTime type and its usage

* DataAPITimestamp covers the stringy rfc3339 formats; used in table converters

* DataAPIVector basics

* binary encoding of vectors in collections + api options to control it

* renamed wire-format options

* limit vector bin-enc for collections to insertions

* fix tests with the new tolerant-on-insert policy for types

* guard against empty-keyspace DBs without 'keyspace' and 'keyspaces' fields on devops responses

* add .region property to databases; optimize vector-path in coll pre/post process; adjust dbInfo tests

* move the pre-post-processing logic out of commander, into collections (tables todo)

* renamed option to 'unroll_iterables_to_list' and used in the general collection preproc route

* rename tpostprocessors; nested nan in lists/maps and its test

* table type-driven preprocessing wip (DataAPITimestamp missing + tests)

* most pre/post processing for tables (except using the custom dt option); missing wiring

* full table pre-post-processors, testing and use of options

* sensible repr and str for DataAPIVector

* converter agent for tables, with caching

* unexpected response exceptions renamed; result classes split T/C; full wiring of pre-post-processing for tables

* rename WireFormatOptions->SerdesOptions; better timeout messages that always give the number in ms

* info methods of async classes are async; adjust collections test re: datetime/DataAPITimestamp; made custom types hashable

* WIP on surfacing original timeouts

* wip 2 on surfacing the nominal timeout values

* surfacing the timeouts as the user configured them

* cursors' for_each and to_list error on closed cursors

* adjust tests to fetch_db_info signature; suspend dropIndex (the command is missing somehow)

* cursor to_list and for_each will error if cursor is closed

* equality method on CollectionDescriptor

* mostly reworked exception tree; added InvalidEnvironmentException

* rearrange and rename collection-specific exceptions

* rearranged exception tree

* final arrangement of exceptions all in astrapy.exceptions

* cursor.has_next can start iteration on IDLE cursor

* less unwieldy repr for XInsertManyResult if many items

* cursors don't accept project after map is set

* if/not/exists option and all the create/drop table/index commands ready

* renamed all TableX custom data types to DataAPIX

* drop_table_index now a Database method

* delete_many for tables; fixes and int.tests for distinct; int.tests for delete_many/one

* full options to (table)find_one + testing

* wip on the decimal management in jsonencoding

* full feature for the decimal-first flag in collections + unit tests

* integration testing of the decimal encoding and related options for collections

* unit test of table codec paths for decimal/number support

* remove CollectionNotFoundException; cleaned out a forgotten table drop_index method

* table deletion methods return None; removed associated XResult classes and related exceptions

* alterTable and tests

* revert to common CumulativeOperationException; remove Table{DeleteMany|UpdateMany}Exception and Table{Delete|Update}Result

* rename test modules tableX to dataapiX; factored the 'c' format for duration logic in a separate module

* wip DataAPIDuration format flip

* DataAPIDuration switched to the ISO-8601-with-signum notation

* table's count_documents, estimated_document_count methods + aliases + unit test

* removed outdated 'astrapy_latest_interface.py'

* table update_one method and test

* table insert_many sync + tests

* table insert_many, async + integration tests

* fix Decimal schema-hashing bug; added IT for update_one

* align cursor class names

* more terse repr of collections and tables

* improve error messages for multi-error DataAPIResponseExceptions

* cursors, reverted to .data_source common property for tables/collections

* v2.0 diagrams (abstractions, exceptions)

* DataAPIClient init and spawner methods all accept api_options besides top named params

* database's get_database_admin accepts admin_api_options parameter

* removed unnecessary token coercion in tests

* uniform api_options to all copy/clone/conversion methods

* remove useless token coercion steps

* minor (typing and typos)

* Table.alter() supports typing and returns the newly-typed table

* Table.alter() accepts a dict which it tries to parse into an Operation

* cursors' get_sort_vector behaves as dictated by serdes options for tables/collections

* include_similarity full support

* support for source_model in create collection

* add tests for paginated table fnid; rename SortDocuments to SortMode (with alias)

* switch to the 6-tier timeout options

* duration, use c-format in write path for lossless (for now)

* remove row-named count methods

* schema-based fillers for missing columns in row,

* table's list_indexes and list_index_names methods + test

* remove cursor .keyspace property

* database 'command' method can target no-keyspace; update param names and streamlined logic

* fixed some tests after the api and client minor changes

* all tests (except countDocuments) passing again

* rename max_time_ms to timeout_ms consistently

* refactored the per-method timeout override chains in a zero-respecting manner

* reinstated use of command() in a test

* DataAPITimestamp has friendlier repr

* adjusted the year/sign part of DataAPITimestamp parsing and stringifying

* tiny fix to timestamp parsing (+0000123 allowed, 0000123 no for year)

* adjusted DataAPIDate parsing and to_string to respect sign-of-year constraints as the API

* add test for the timeout overrides including passing zero

* added timeout-override and timeout-zero test for async collection

* tables, int. test restructure+enrich wip

* wip for tuple right typing in ids

* proper type handling in insertedIds (dict+tuple) and its testing

* a mostly complete integration test suite for tables

* DataAPIMap and DataAPISet __eq__ method behaves like regular maps and sets; completed read-then-write-all-types tests

* bugfix: token passthrough in the async_fetch_database_info

* standard table vectorize integration tests

* include sort vector, include similarity; covered by table vectorize tests

* more table IT coverage

* bigfix: equality of DataAPIMap

* I test of table command

* some more find IT for tables

* increase default per-req timeout to 10s

* tables, full IT coverage of find

* full findOne IT for tables

* full integration test coverage of table cursors

* wip3 naming timeouts in errors

* wip1 fine-align timeouts

* wip2  fine-align timeouts

* full alignment to timeout management

* split Create- vs List- TableIndexDefinition and TableIndexDescriptor

* index creation/list final API for tables

* CollectionOptions -> CollectionDefinition class rename

* from_dict -> _from_dict method consistently

* cursors, for_each and to_list start where consumtion stopped

* callback to for_each can stop early by returning False

* added a tiny bit of testing to table cursors with foreach

* added all collection cursor integration tests

* table class docstrings

* made some internal-method param required; remove any check/error on include_sort_vector and include_similarity

* docstring fixes; in part. move tokens out of client (unless admin example docstrings)

* table index creation new signature (for real)

* first quickstart and some more timezonecare in the readme

* table create_index has optional options param

* better readme quickstarts (t/c both)

* table.py docstrings: create_index, create_vector_index, list_index_names, list_indexes, alter (+async)

* table docstring wip: halfway throug find

* minor parameters to table-creation structures made optional; more table docstrings

* more docstrings to table.py

* sync table docstrings tier0 done

* full tier-0 table.py docstring, incl async

* more standardization of table.py docstrings

* TableVectorIndexOptions can be coerced from None; create_vector_index has optional options; minor docs improvement

* more docstring improvement around tables

* final datetime/timezone serdes options, completed

* adjusted tests in the wake of datetime tzinfo rework

* systematc, consistent rewrite of the options to copy and spawn methods for the various abstractions

* fix clipped datetime diagram picture

* conftest param naming update

* minor IT adjustments

* create/get[table/coll] docstrings done, vectorize IT improved

* adapt a vectorize test to DataAPIVector

* wip on createCollection arg unflattening

* create_collection signature rework + fluent interface, completed

* table creation docstring order fix

* column_type may be omitted for vector column type descriptor

* param name change in builder method; better repr for DataAPIMap

* AsyncDatabase: get_table and get_collection methods are not async functions anymore

* environment locked in APIOptions

* TODO cleanup in tests

* api_options: all docstrings; fixed a couple of spawn/api_option parameter names here and there

* datetime serdes example in readme

* a small apioptions example in readme

* minor api-option docstring changes

* docstring for date and vector

* docstring all of the custom data types

* more docstrings

* rename CursorState->FindCursorState; most cursor docstrings

* full cursor docstrings

* simplified drop_table and drop_collection to only accept the string name of the target to drop

* wip typing finds

* add type parameter to find methods for returned items

* more docstring; all collection vector writes abide by binary_encode_vectors setting

* disable (for now) collection vector binary encoding altogether

* all docstrings in table.py and database_info.py

* docstring for collection.py

* all database.py docstrings done

* table descriptors, docstrings ok

* all docstrings done

* primitive->scalar terminology consistently for columns

* rewritten CHANGES file

* mark version as preview; upgrade hcd docker-compose data api image

* comment a stupid flaky test

* another tricky async timeout test gone

* another tricky async timeout test gone 2

* disabled most of the timeout tests with httpsserver

* removed the alias SortMode->SortDocuments

* builder interface renamed to .builder()---.build() pattern

* renamed TableScalarColumnType -> ColumnType

* wip toward proper list/create split for collection def/descr

* split list/create table descriptors for real

v1.5.2

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
bugfix: get_collection has callers inheritance now (#319)

v1.5.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
More deprecations and several fixes for v1.5.1 (#318)

* resilience against devops api not returning keyspace/keyspaces in the GET databases/ID endpoint

* changesfile

* Consistent handling of deletedCount=-1 from the API (always returned as-is)

* bump to 1.5.1 + deprecate all set_caller calls

* remove ragstack detection

* deprecate caller_name/_version in favor of callers everywhere; tests to augment still

* callers is Sequence; adjusted test_admin_conversions

* adapted test_collections x2

* split caller_x vs callers in all unit tests

* callers deprecation and identity tests completed

* docstring examples ditch caller_name/caller_version altogether

* list_databases + async have options and pagination

* remove stray comment

* docstr and py3.8 compliant type

* reshuffled client.py to endpoint-first/then id + code optimization

* better handling of no-endpoint, no-id init params for client.py

* WIP on reshuffling admin which retain id/region as a second option

* admin reshuffled: get_db_admin, get[async]database allow endpt AND id

* endpoint-first flows, remove constructor unwanted params; logic cleanup and adjust unit tests

* client.py deprecates use of id in get[async]database

* all tests pass

* rework cursors: state is enum; aligned state names

* deprecation of Cursor.retrieved

* cursor: deprecate 'collection' property for 'data_source'

* changesfile

* take cassio dependency out (which also removes numpy)

v1.5.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Deprecation of all things "namespace" (#316)

* logging WARNINGs from Data API

* deprecate bulk_write

* keyspace method introduced + deprecation of namespace-same-named ones

* property-adjusted testing in idiomatic

* all namespace-methods deprecated and replicated with keyspace

* introduce update_db_keyspace parameter, deprecate update_db_namespace + tests

* fixed the deprecation of 'namespace' when it is a property

* fix/simplify stacklevel logic for deprecation utilities

* first sweep to rename internal variables

* second sweep to rename internal variables

* exceptions, constants and a few renames in tests

* DatabaseInfo and CollectionInfo double-attributes

* keyspace as parameter to all methods, with namespace as deprecated alias

* all 'namespace=' renamed

* swept/cleaned docstrings and stray references

* most of the test assets cleaned as well

* adapt to nulls-vs-absent ambiguity in findEmbProv responses

* ensure forced dimensions overcome whether defaultValue=null for dimension in findEmvProv response

* bump to 1.5.0

v1.4.2

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Tiny fix to a core test (#313)

* bump to 1.4.2

* changes file formatting

* fix nonexistent collection name in a (core) failure test

v1.4.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Replace bson dependency with pymongo (#297)

* Replace bson dependency with pymongo

* changesfile; poetry.lock

---------

Co-authored-by: Stefano Lottini <stefano.lottini@datastax.com>

v1.4.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Toward 1.4.0 (findEmbeddingProviders; HCD namespace idioms; region/en…

…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

v1.3.1

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
SL ready for 1.3.1 (#288)

* bump to 1.3.1
* new abstractions diagram; ready for 1.3.1
* fight flaky count docs test

v1.3.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Version 1.3 (#285)

* reinstate collection.delete_many with empty filter for truncate

* deprecation of delete_all (+related test utilities); removal of old core aliased methods

* Deprecation sine die of bulk_write

* changes

* vector/s/ize params deprecation, collection.py

* resiliency of tests (core+idiomatic) to vector not being returned under certain conditions

* improved vectorize_methods settings handling; partial support for hfded and oaiparams

* shorten model root name

* hf ded tweaks to vectorize coll models generation

* adapt vectorize tests to hf ded

* deprecation of vector/ize orderly brought to all Operation classes

* revert deprecation of bulk_insert

* adapt testing to modelName management in HD dedicated

* tests capture and check deprecations for all usages of vector/ize= standalone params

* added HCD and CASSANDRA to the Environment values

* more clarity in string repr of cursors

* use type alias for filter consistently

* callback mechanism to store the sort vector

* expose include_sort_vector option to find

* add prefetch iterator wrappers for the returnvector

* prefetching for include_sort_vector

* revert nullable-model-name changes and cope with disappeared .providerKey suffix in tests

* include_sort_vector and get_sort_vector, extensive test coverage

* add code examples for get_sort_vector in docstring for the two find methods

* add Content-Type header to all api requests

* changelog update

* token providers

* full transition to TokenProvider

* vectorize: support testing of openai project/org ids

* rename attribute token -> token_provider where needed

* docstring about token provider

* token inheritance tests; eq and copy methods of api commander

* changes file

* tests: modernize and lift upward fixtures and paradigmaticize object creation; add test on tokenless client

* astra/nonastra plug-your-db management

* astra/nonastra management fully covers vectorize

* nonAstra admin (i.e. namespace crud) tests

* rework fixture inheritance and naming for alternate keyspace (incl.astra/nonastra)