Skip to content

Commit

Permalink
Deprecation of all things "namespace" (#316)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
hemidactylus authored Sep 21, 2024
1 parent bdf08a4 commit bd99707
Show file tree
Hide file tree
Showing 39 changed files with 2,636 additions and 898 deletions.
14 changes: 11 additions & 3 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
master
======
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
Expand All @@ -16,6 +23,7 @@ Rearrangement into separate modules for:
- 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
Expand Down Expand Up @@ -53,7 +61,7 @@ DatabaseAdmin classes retain a reference to the Async/Database instance that spa
- 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
- default to "default_keyspace" 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:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ print(db_info.name, db_info.id, db_info.region)

my_database_admin = my_astra_admin.get_database_admin(db_info.id)

my_database_admin.list_namespaces()
my_database_admin.create_namespace("my_dreamspace")
my_database_admin.list_keyspaces()
my_database_admin.create_keyspace("my_dreamspace")
```

### Exceptions
Expand Down
Loading

0 comments on commit bd99707

Please sign in to comment.