adapta 5.2.3__tar.gz → 5.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {adapta-5.2.3 → adapta-5.3.0}/PKG-INFO +1 -1
- {adapta-5.2.3 → adapta-5.3.0}/pyproject.toml +1 -1
- {adapta-5.2.3 → adapta-5.3.0}/pyproject.toml.orig +1 -1
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/iceberg/v1/_functions.py +14 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/_functions.py +0 -1
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/__init__.py +5 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/_functions.py +8 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/_models.py +13 -1
- adapta-5.3.0/src/adapta/storage/query_enabled_store/_qes_cassandra.py +173 -0
- {adapta-5.2.3 → adapta-5.3.0}/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/_version.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/connectors/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/connectors/service_bus/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/connectors/service_bus/_connector.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/dataclass/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/dataclass/dataclass_abstract.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/dataclass/dataclass_core.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/validation/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/validation/validation.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/validation/validation_abstract.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/validation/validation_polars.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/validation/validation_utils.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/_async_logger.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/_base.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/_internal.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/_internal_logger.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/_logger_interface.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/handlers/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/handlers/datadog_api_handler.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/handlers/safe_stream_handler.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/models/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/models/_log_level.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/models/_logs_metadata.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/providers/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/logs/providers/void_logger.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/metrics/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/metrics/_base.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/metrics/providers/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/metrics/providers/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/metrics/providers/datadog_provider.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/metrics/providers/void_provider.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/ml/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/ml/_model.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/ml/mlflow/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/ml/mlflow/_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/ml/mlflow/_functions.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/process_communication/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/process_communication/_models.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/schema_management/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/schema_management/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/schema_management/schema_entity.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/_azure_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/_base.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/_local_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/aws/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/aws/_aws_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/aws/_aws_credentials.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/hashicorp_vault/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/hashicorp_vault/hashicorp_vault_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/hashicorp_vault/kubernetes_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/hashicorp_vault/oidc_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/hashicorp_vault/token_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/blob/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/blob/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/blob/azure_storage_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/blob/base.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/blob/local_storage_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/blob/s3_storage_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/cache/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/cache/_base.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/cache/redis_cache.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/v3/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/v3/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/v3/azure_sql.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/v3/models/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/v3/models/_models.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/v3/odbc.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/v3/snowflake_sql.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/database/v3/trino_sql.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/delta_lake/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/delta_lake/v3/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/delta_lake/v3/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/delta_lake/v3/_functions.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/delta_lake/v3/_models.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/keyspace_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/keyspaces-certificate.pem +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/cassandra_client/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/cassandra_client/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/cassandra_client/_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/cassandra_client/_client_configuration.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/cassandra_client/_model_mappers.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/datastax_astra/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/datastax_astra/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/datastax_astra/_models.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/datastax_astra/astra_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/vanilla_cassandra/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/vanilla_cassandra/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/vanilla_cassandra/vanilla_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/exceptions.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/iceberg/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/iceberg/v1/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/iceberg/v1/_models.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/astra.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/aws.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/azure.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/base.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/cassandra.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/enum.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/arrow_filter_expression.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/cassandra_filter_expression.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/filter_expression.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/iceberg_filter_expression.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/trino_filter_expression.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/format.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/formatters/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/formatters/dict.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/formatters/exceptions.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/formatters/metaframe.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/formatters/pandas.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/formatters/pickle.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/formatters/polars.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/formatters/unit.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/hive.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/iceberg.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/local.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/trino.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/_qes_astra.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/_qes_delta.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/_qes_iceberg.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/_qes_local.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/_qes_trino.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/parameters/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/parameters/_base.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/parameters/_read_parameters.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/parameters/_write_parameters.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/secrets/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/secrets/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/secrets/_base.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/secrets/azure_secret_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/secrets/hashicorp_vault_secret_storage_client.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/sync/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/sync/iceberg_to_cass.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/README.md +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/_common.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/_requests.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/concurrent_task_runner.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/data_structures/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/data_structures/_functions.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/decorators/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/decorators/_logging.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/decorators/_rate_limit.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/metaframe.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/polars.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/python_typing/__init__.py +0 -0
- {adapta-5.2.3 → adapta-5.3.0}/src/adapta/utils/python_typing/_functions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: adapta
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.3.0
|
|
4
4
|
Summary: Logging, data connectors, monitoring, secret handling and general lifehacks to make data people lives easier.
|
|
5
5
|
Author: ECCO Data & AI
|
|
6
6
|
Author-email: ECCO Data & AI <esdsupport@ecco.com>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "adapta"
|
|
3
|
-
version = "5.
|
|
3
|
+
version = "5.3.0"
|
|
4
4
|
description = "Logging, data connectors, monitoring, secret handling and general lifehacks to make data people lives easier."
|
|
5
5
|
authors = [{ name = "ECCO Data & AI", email = "esdsupport@ecco.com" }]
|
|
6
6
|
requires-python = ">=3.11, <3.16"
|
|
@@ -157,6 +157,7 @@ def write_using_catalog(
|
|
|
157
157
|
data: polars.DataFrame | polars.LazyFrame,
|
|
158
158
|
write_chunk_size: int = 50_000,
|
|
159
159
|
overwrite: bool = True,
|
|
160
|
+
create_schema: bool = False,
|
|
160
161
|
merge_columns: list[str] | None = None,
|
|
161
162
|
delete_filter: Expression | None = None,
|
|
162
163
|
) -> None:
|
|
@@ -168,9 +169,22 @@ def write_using_catalog(
|
|
|
168
169
|
Note when using S3 compatible storage: if you are getting checksum validation errors, add these two env variables:
|
|
169
170
|
os.environ["AWS_REQUEST_CHECKSUM_CALCULATION"] = "WHEN_REQUIRED"
|
|
170
171
|
os.environ["AWS_RESPONSE_CHECKSUM_VALIDATION"] = "WHEN_REQUIRED"
|
|
172
|
+
|
|
173
|
+
:param schema_name: name of the schema
|
|
174
|
+
:param table_name: name of the table
|
|
175
|
+
:param catalog: catalog to use for writing
|
|
176
|
+
:param data: dataframe containing the data to write
|
|
177
|
+
:param write_chunk_size: number of rows to write per chunk
|
|
178
|
+
:param overwrite: flag to overwrite the existing data
|
|
179
|
+
:param create_schema: flag to automatically create the schema if not exists
|
|
180
|
+
:param merge_column: if provided an upsert will be performed using the list of columns for merging
|
|
181
|
+
:param delete_filter: if provided all rows that match this expression will be deleted before writing data
|
|
182
|
+
|
|
171
183
|
"""
|
|
172
184
|
|
|
173
185
|
def _get_table(table_schema: Schema) -> pyiceberg.table.Table:
|
|
186
|
+
if create_schema:
|
|
187
|
+
catalog.create_namespace_if_not_exists(namespace=schema_name)
|
|
174
188
|
if catalog.table_exists(identifier=(schema_name, table_name)):
|
|
175
189
|
return catalog.load_table(identifier=(schema_name, table_name))
|
|
176
190
|
|
|
@@ -23,6 +23,11 @@ try:
|
|
|
23
23
|
except (ImportError, ModuleNotFoundError) as ex:
|
|
24
24
|
print(f"Query Enabled Store (Astra - Cassandra) not configured: {ex}")
|
|
25
25
|
|
|
26
|
+
try:
|
|
27
|
+
from adapta.storage.query_enabled_store._qes_cassandra import *
|
|
28
|
+
except (ImportError, ModuleNotFoundError) as ex:
|
|
29
|
+
print(f"Query Enabled Store (Cassandra) not configured: {ex}")
|
|
30
|
+
|
|
26
31
|
try:
|
|
27
32
|
from adapta.storage.query_enabled_store._qes_delta import *
|
|
28
33
|
except (ImportError, ModuleNotFoundError) as ex:
|
|
@@ -2,6 +2,7 @@ from adapta.process_communication import DataSocket
|
|
|
2
2
|
from adapta.storage.models import (
|
|
3
3
|
AdlsGen2Path,
|
|
4
4
|
AstraPath,
|
|
5
|
+
CassandraPath,
|
|
5
6
|
IcebergPath,
|
|
6
7
|
LocalPath,
|
|
7
8
|
S3Path,
|
|
@@ -15,6 +16,11 @@ try:
|
|
|
15
16
|
except (ImportError, ModuleNotFoundError) as ex:
|
|
16
17
|
print(f"Query Enabled Store (Astra) not configured: {ex}")
|
|
17
18
|
|
|
19
|
+
try:
|
|
20
|
+
from adapta.storage.query_enabled_store._qes_cassandra import CassandraQueryEnabledStore
|
|
21
|
+
except (ImportError, ModuleNotFoundError) as ex:
|
|
22
|
+
print(f"Query Enabled Store (Cassandra) not configured: {ex}")
|
|
23
|
+
|
|
18
24
|
try:
|
|
19
25
|
from adapta.storage.query_enabled_store._qes_iceberg import IcebergQueryEnabledStore
|
|
20
26
|
except (ImportError, ModuleNotFoundError) as ex:
|
|
@@ -45,6 +51,8 @@ def suggest_store(socket: DataSocket) -> type[QueryEnabledStore] | None:
|
|
|
45
51
|
return LocalQueryEnabledStore
|
|
46
52
|
if isinstance(path_impl, AstraPath):
|
|
47
53
|
return AstraQueryEnabledStore
|
|
54
|
+
if isinstance(path_impl, CassandraPath):
|
|
55
|
+
return CassandraQueryEnabledStore
|
|
48
56
|
if isinstance(path_impl, (S3Path, WasbPath, AdlsGen2Path)):
|
|
49
57
|
return DeltaQueryEnabledStore
|
|
50
58
|
if isinstance(path_impl, TrinoPath):
|
|
@@ -25,6 +25,9 @@ from functools import partial
|
|
|
25
25
|
from pydoc import locate
|
|
26
26
|
from typing import Any, Generic, Self, TypeVar, final
|
|
27
27
|
|
|
28
|
+
from adapta.logs import LoggerInterface, VoidLogger
|
|
29
|
+
from adapta.metrics import MetricsProvider
|
|
30
|
+
from adapta.metrics.providers.void_provider import VoidMetricsProvider
|
|
28
31
|
from adapta.storage.models.base import DataPath
|
|
29
32
|
from adapta.storage.models.enum import QueryEnabledStoreOptions
|
|
30
33
|
from adapta.storage.models.expression_dsl.filter_expression import Expression
|
|
@@ -64,6 +67,7 @@ class BundledQueryEnabledStores(Enum):
|
|
|
64
67
|
|
|
65
68
|
DELTA = "adapta.storage.query_enabled_store.DeltaQueryEnabledStore"
|
|
66
69
|
ASTRA = "adapta.storage.query_enabled_store.AstraQueryEnabledStore"
|
|
70
|
+
CASSANDRA = "adapta.storage.query_enabled_store.CassandraQueryEnabledStore"
|
|
67
71
|
LOCAL = "adapta.storage.query_enabled_store.LocalQueryEnabledStore"
|
|
68
72
|
TRINO = "adapta.storage.query_enabled_store.TrinoQueryEnabledStore"
|
|
69
73
|
ICEBERG = "adapta.storage.query_enabled_store.IcebergQueryEnabledStore"
|
|
@@ -77,9 +81,17 @@ class QueryEnabledStore(ABC, Generic[TCredential, TSettings]):
|
|
|
77
81
|
QES base class.
|
|
78
82
|
"""
|
|
79
83
|
|
|
80
|
-
def __init__(
|
|
84
|
+
def __init__(
|
|
85
|
+
self,
|
|
86
|
+
credentials: TCredential,
|
|
87
|
+
settings: TSettings,
|
|
88
|
+
logger: LoggerInterface | None = None,
|
|
89
|
+
metrics_provider: MetricsProvider | None = None,
|
|
90
|
+
):
|
|
81
91
|
self._credentials = credentials
|
|
82
92
|
self._settings = settings
|
|
93
|
+
self._logger = logger or VoidLogger()
|
|
94
|
+
self._metrics_provider = metrics_provider or VoidMetricsProvider()
|
|
83
95
|
|
|
84
96
|
@property
|
|
85
97
|
def credentials(self) -> TCredential:
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"""
|
|
2
|
+
QES implementations for Cassandra.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import re
|
|
7
|
+
from collections.abc import Iterator
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import final
|
|
10
|
+
|
|
11
|
+
from dataclasses_json import DataClassJsonMixin
|
|
12
|
+
|
|
13
|
+
from adapta.storage.distributed_object_store.v3.aws_keyspaces.keyspace_client import AwsKeyspaceClient
|
|
14
|
+
from adapta.storage.distributed_object_store.v3.vanilla_cassandra import VanillaCassandraClient
|
|
15
|
+
from adapta.storage.models.base import DataPath
|
|
16
|
+
from adapta.storage.models.cassandra import CassandraPath
|
|
17
|
+
from adapta.storage.models.enum import QueryEnabledStoreOptions
|
|
18
|
+
from adapta.storage.models.expression_dsl.filter_expression import Expression
|
|
19
|
+
from adapta.storage.query_enabled_store._models import (
|
|
20
|
+
CONNECTION_STRING_REGEX,
|
|
21
|
+
QueryEnabledStore,
|
|
22
|
+
)
|
|
23
|
+
from adapta.utils.metaframe import MetaFrame
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass
|
|
27
|
+
class CassandraCredential(DataClassJsonMixin):
|
|
28
|
+
"""
|
|
29
|
+
Cassandra credential placeholder for QES. Authentication is performed via SigV4 using the AWS profile
|
|
30
|
+
defined in settings, so no secrets are held here.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
username: str | None = None
|
|
34
|
+
password: str | None = None
|
|
35
|
+
|
|
36
|
+
def __post_init__(self):
|
|
37
|
+
self.username = self.username or os.getenv("ADAPTA__CASS_USERNAME")
|
|
38
|
+
self.password = self.password or os.getenv("ADAPTA__CASS_PASSWORD")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass
|
|
42
|
+
class CassandraSettings(DataClassJsonMixin):
|
|
43
|
+
"""
|
|
44
|
+
Cassandra connection settings for QES.
|
|
45
|
+
|
|
46
|
+
:attr client_name: Name of the client reported to the cluster.
|
|
47
|
+
:attr keyspace: Keyspace to connect to.
|
|
48
|
+
:attr region: AWS region hosting the keyspace.
|
|
49
|
+
:attr profile_name: AWS profile name used for SigV4 authentication.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
client_name: str | None = None
|
|
53
|
+
keyspace: str | None = None
|
|
54
|
+
aws_region: str | None = None
|
|
55
|
+
aws_profile_name: str | None = None
|
|
56
|
+
contact_points: list[str] | None = None
|
|
57
|
+
|
|
58
|
+
def __post_init__(self):
|
|
59
|
+
self.client_name = self.client_name or os.getenv("ADAPTA__CASS_CLIENT_NAME")
|
|
60
|
+
self.keyspace = self.keyspace or os.getenv("ADAPTA__CASS_KEYSPACE")
|
|
61
|
+
self.aws_region = self.aws_region or os.getenv("ADAPTA__CASS_AWS_REGION")
|
|
62
|
+
self.aws_profile_name = self.aws_profile_name or os.getenv("ADAPTA__CASS_AWS_PROFILE_NAME")
|
|
63
|
+
self.contact_points = self.contact_points or os.getenv("ADAPTA__CONTACT_POINTS") or ["127.0.0.1"]
|
|
64
|
+
|
|
65
|
+
if not all([self.keyspace, self.client_name]):
|
|
66
|
+
raise RuntimeError(
|
|
67
|
+
"Authentication information provided is insufficient. Please verify you are supplying keyspace and "
|
|
68
|
+
"client name via connection string or via environment variables."
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@final
|
|
73
|
+
class CassandraQueryEnabledStore(QueryEnabledStore[CassandraCredential, CassandraSettings]):
|
|
74
|
+
"""
|
|
75
|
+
QES Client for Cassandra.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
def _write(
|
|
79
|
+
self,
|
|
80
|
+
path: DataPath,
|
|
81
|
+
data: MetaFrame | Iterator[MetaFrame],
|
|
82
|
+
block_size: int,
|
|
83
|
+
overwrite: bool,
|
|
84
|
+
merge_columns: list[str] | None = None,
|
|
85
|
+
delete_filter: Expression | None = None,
|
|
86
|
+
) -> None:
|
|
87
|
+
raise NotImplementedError("Writing not supported by this QES engine.")
|
|
88
|
+
|
|
89
|
+
def close(self) -> None:
|
|
90
|
+
if not self._lazy:
|
|
91
|
+
self._cassandra_client.disconnect()
|
|
92
|
+
|
|
93
|
+
def __init__(self, credentials: CassandraCredential, settings: CassandraSettings, lazy_init: bool):
|
|
94
|
+
super().__init__(credentials, settings)
|
|
95
|
+
self._cassandra_client = self._resolve_client()
|
|
96
|
+
self._lazy = lazy_init
|
|
97
|
+
if not lazy_init:
|
|
98
|
+
self._cassandra_client.connect()
|
|
99
|
+
|
|
100
|
+
def _resolve_client(self):
|
|
101
|
+
"""
|
|
102
|
+
Resolves the Cassandra client.
|
|
103
|
+
"""
|
|
104
|
+
if self.settings.aws_region:
|
|
105
|
+
return AwsKeyspaceClient(
|
|
106
|
+
keyspace=self.settings.keyspace,
|
|
107
|
+
client_name=self.settings.client_name,
|
|
108
|
+
region=self.settings.aws_region,
|
|
109
|
+
profile_name=self.settings.aws_profile_name,
|
|
110
|
+
logger=self._logger,
|
|
111
|
+
metrics_provider=self._metrics_provider,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return VanillaCassandraClient(
|
|
115
|
+
keyspace=self.settings.keyspace,
|
|
116
|
+
client_name=self.settings.client_name,
|
|
117
|
+
username=self.credentials.username,
|
|
118
|
+
password=self.credentials.password,
|
|
119
|
+
contact_points=self.settings.contact_points,
|
|
120
|
+
logger=self._logger,
|
|
121
|
+
metrics_provider=self._metrics_provider,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
def _apply_filter(
|
|
125
|
+
self,
|
|
126
|
+
path: DataPath,
|
|
127
|
+
filter_expression: Expression,
|
|
128
|
+
columns: list[str],
|
|
129
|
+
options: dict[QueryEnabledStoreOptions, any] | None = None,
|
|
130
|
+
limit: int | None = 10000,
|
|
131
|
+
) -> MetaFrame | Iterator[MetaFrame]:
|
|
132
|
+
assert isinstance(path, CassandraPath)
|
|
133
|
+
cassandra_path: CassandraPath = path
|
|
134
|
+
if self._lazy:
|
|
135
|
+
with self._cassandra_client as cassandra_client:
|
|
136
|
+
return cassandra_client.filter_entities(
|
|
137
|
+
model_class=cassandra_path.model_class(),
|
|
138
|
+
key_column_filter_values=filter_expression,
|
|
139
|
+
keyspace=cassandra_path.keyspace,
|
|
140
|
+
table_name=cassandra_path.table,
|
|
141
|
+
select_columns=columns,
|
|
142
|
+
num_threads=-1, # auto-infer, see method documentation
|
|
143
|
+
options=options,
|
|
144
|
+
limit=limit,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
return self._cassandra_client.filter_entities(
|
|
148
|
+
model_class=cassandra_path.model_class(),
|
|
149
|
+
key_column_filter_values=filter_expression,
|
|
150
|
+
keyspace=cassandra_path.keyspace,
|
|
151
|
+
table_name=cassandra_path.table,
|
|
152
|
+
select_columns=columns,
|
|
153
|
+
num_threads=-1, # auto-infer, see method documentation
|
|
154
|
+
options=options,
|
|
155
|
+
limit=limit,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
def _apply_query(self, query: str) -> MetaFrame | Iterator[MetaFrame]:
|
|
159
|
+
if self._lazy:
|
|
160
|
+
with self._cassandra_client as cassandra_client:
|
|
161
|
+
return cassandra_client.get_entities_raw(query)
|
|
162
|
+
return self._cassandra_client.get_entities_raw(query)
|
|
163
|
+
|
|
164
|
+
@classmethod
|
|
165
|
+
def _from_connection_string(
|
|
166
|
+
cls, connection_string: str, lazy_init: bool = False
|
|
167
|
+
) -> "QueryEnabledStore[CassandraCredential, CassandraSettings]":
|
|
168
|
+
_, credentials, settings = re.findall(re.compile(CONNECTION_STRING_REGEX), connection_string)[0]
|
|
169
|
+
return cls(
|
|
170
|
+
credentials=CassandraCredential.from_json(credentials),
|
|
171
|
+
settings=CassandraSettings.from_json(settings),
|
|
172
|
+
lazy_init=lazy_init,
|
|
173
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/dataclass/dataclass_abstract.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/validation/validation_abstract.py
RENAMED
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/validation/validation_polars.py
RENAMED
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/dataclass_validation/validation/validation_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/hashicorp_vault/hashicorp_vault_client.py
RENAMED
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/security/clients/hashicorp_vault/kubernetes_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/arrow_filter_expression.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/iceberg_filter_expression.py
RENAMED
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/models/expression_dsl/trino_filter_expression.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/parameters/_read_parameters.py
RENAMED
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/query_enabled_store/parameters/_write_parameters.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.2.3 → adapta-5.3.0}/src/adapta/storage/secrets/hashicorp_vault_secret_storage_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|