Module astrapy.constants
Functions
def normalize_optional_projection(projection: ProjectionType | None) ‑> dict[str, bool | dict[str, int | collections.abc.Iterable[int]]] | None-
Expand source code
def normalize_optional_projection( projection: ProjectionType | None, ) -> dict[str, bool | dict[str, int | Iterable[int]]] | None: if projection: if isinstance(projection, dict): # already a dictionary return projection else: # an iterable over strings: coerce to allow-list projection return {field: True for field in projection} else: return None
Classes
class DatabaseStatus (*args, **kwds)-
Expand source code
class DatabaseStatus(StrEnum): """ Admitted values for the status of a database as returned by Astra DB. To avoid the risk of a newly-introduced status (by the DevOps API) breaking the clients, this enum is used only for reference and no coercion from server-received status strings is enforced. """ ACTIVE = "ACTIVE" ASSOCIATING = "ASSOCIATING" DECOMMISSIONING = "DECOMMISSIONING" DEGRADED = "DEGRADED" ERROR = "ERROR" HIBERNATED = "HIBERNATED" HIBERNATING = "HIBERNATING" INITIALIZING = "INITIALIZING" MAINTENANCE = "MAINTENANCE" PARKED = "PARKED" PARKING = "PARKING" PENDING = "PENDING" PREPARED = "PREPARED" PREPARING = "PREPARING" RESIZING = "RESIZING" RESUMING = "RESUMING" SYNCHRONIZING = "SYNCHRONIZING" TERMINATED = "TERMINATED" TERMINATING = "TERMINATING" UNKNOWN = "UNKNOWN" UNPARKING = "UNPARKING"Admitted values for the status of a database as returned by Astra DB.
To avoid the risk of a newly-introduced status (by the DevOps API) breaking the clients, this enum is used only for reference and no coercion from server-received status strings is enforced.
Ancestors
- StrEnum
- enum.Enum
Class variables
var ACTIVE-
The type of the None singleton.
var ASSOCIATING-
The type of the None singleton.
var DECOMMISSIONING-
The type of the None singleton.
var DEGRADED-
The type of the None singleton.
var ERROR-
The type of the None singleton.
var HIBERNATED-
The type of the None singleton.
var HIBERNATING-
The type of the None singleton.
var INITIALIZING-
The type of the None singleton.
var MAINTENANCE-
The type of the None singleton.
var PARKED-
The type of the None singleton.
var PARKING-
The type of the None singleton.
var PENDING-
The type of the None singleton.
var PREPARED-
The type of the None singleton.
var PREPARING-
The type of the None singleton.
var RESIZING-
The type of the None singleton.
var RESUMING-
The type of the None singleton.
var SYNCHRONIZING-
The type of the None singleton.
var TERMINATED-
The type of the None singleton.
var TERMINATING-
The type of the None singleton.
var UNKNOWN-
The type of the None singleton.
var UNPARKING-
The type of the None singleton.
Inherited members
class DefaultIdType-
Expand source code
class DefaultIdType: """ Admitted values for the "default_id_type" parameter to use in CollectionDefaultIDOptions object, needed when creating collections through the database `create_collection` method. """ def __init__(self) -> None: raise NotImplementedError UUID = "uuid" OBJECTID = "objectId" UUIDV6 = "uuidv6" UUIDV7 = "uuidv7" DEFAULT = "uuid"Admitted values for the "default_id_type" parameter to use in CollectionDefaultIDOptions object, needed when creating collections through the database
create_collectionmethod.Class variables
var DEFAULT-
The type of the None singleton.
var OBJECTID-
The type of the None singleton.
var UUID-
The type of the None singleton.
var UUIDV6-
The type of the None singleton.
var UUIDV7-
The type of the None singleton.
class Environment-
Expand source code
class Environment: """ Admitted values for `environment` property, denoting the targeted API deployment type. """ def __init__(self) -> None: raise NotImplementedError PROD = "prod" DEV = "dev" TEST = "test" DSE = "dse" HCD = "hcd" CASSANDRA = "cassandra" OTHER = "other" values = {PROD, DEV, TEST, DSE, HCD, CASSANDRA, OTHER} astra_db_values = {PROD, DEV, TEST}Admitted values for
environmentproperty, denoting the targeted API deployment type.Class variables
var CASSANDRA-
The type of the None singleton.
var DEV-
The type of the None singleton.
var DSE-
The type of the None singleton.
var HCD-
The type of the None singleton.
var OTHER-
The type of the None singleton.
var PROD-
The type of the None singleton.
var TEST-
The type of the None singleton.
var astra_db_values-
The type of the None singleton.
var values-
The type of the None singleton.
class MapEncodingMode (*args, **kwds)-
Expand source code
class MapEncodingMode(StrEnum): """ Enum for the possible values of the setting controlling whether to encode dicts/DataAPIMaps as lists of pairs ("association lists") in table payloads. """ NEVER = "NEVER" DATAAPIMAPS = "DATAAPIMAPS" ALWAYS = "ALWAYS"Enum for the possible values of the setting controlling whether to encode dicts/DataAPIMaps as lists of pairs ("association lists") in table payloads.
Ancestors
- StrEnum
- enum.Enum
Class variables
var ALWAYS-
The type of the None singleton.
var DATAAPIMAPS-
The type of the None singleton.
var NEVER-
The type of the None singleton.
Inherited members
class ModelStatus (*args, **kwds)-
Expand source code
class ModelStatus(StrEnum): """ Admitted values for the status of a (reranking/embedding) model, as returned by the corresponding Data API query. """ ALL = "" SUPPORTED = "SUPPORTED" DEPRECATED = "DEPRECATED" END_OF_LIFE = "END_OF_LIFE"Admitted values for the status of a (reranking/embedding) model, as returned by the corresponding Data API query.
Ancestors
- StrEnum
- enum.Enum
Class variables
var ALL-
The type of the None singleton.
var DEPRECATED-
The type of the None singleton.
var END_OF_LIFE-
The type of the None singleton.
var SUPPORTED-
The type of the None singleton.
Inherited members
class ReturnDocument-
Expand source code
class ReturnDocument: """ Admitted values for the `return_document` parameter in `find_one_and_replace` and `find_one_and_update` collection methods. """ def __init__(self) -> None: raise NotImplementedError BEFORE = "before" AFTER = "after"Admitted values for the
return_documentparameter infind_one_and_replaceandfind_one_and_updatecollection methods.Class variables
var AFTER-
The type of the None singleton.
var BEFORE-
The type of the None singleton.
class SortMode-
Expand source code
class SortMode: """ Admitted values for the `sort` parameter in the find collection methods, e.g. `sort={"field": SortMode.ASCENDING}`. """ def __init__(self) -> None: raise NotImplementedError ASCENDING = 1 DESCENDING = -1Admitted values for the
sortparameter in the find collection methods, e.g.sort={"field": SortMode.ASCENDING}.Class variables
var ASCENDING-
The type of the None singleton.
var DESCENDING-
The type of the None singleton.
class VectorMetric-
Expand source code
class VectorMetric: """ Admitted values for the "metric" parameter to use in CollectionVectorOptions object, needed when creating vector collections through the database `create_collection` method. """ def __init__(self) -> None: raise NotImplementedError DOT_PRODUCT = "dot_product" EUCLIDEAN = "euclidean" COSINE = "cosine"Admitted values for the "metric" parameter to use in CollectionVectorOptions object, needed when creating vector collections through the database
create_collectionmethod.Class variables
var COSINE-
The type of the None singleton.
var DOT_PRODUCT-
The type of the None singleton.
var EUCLIDEAN-
The type of the None singleton.