adapta 5.3.6__tar.gz → 5.3.7__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.3.6 → adapta-5.3.7}/PKG-INFO +1 -1
- {adapta-5.3.6 → adapta-5.3.7}/pyproject.toml +1 -1
- {adapta-5.3.6 → adapta-5.3.7}/pyproject.toml.orig +1 -1
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/cassandra_client/_client.py +67 -46
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/sync/iceberg_to_cass.py +49 -22
- {adapta-5.3.6 → adapta-5.3.7}/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/_version.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/connectors/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/connectors/service_bus/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/connectors/service_bus/_connector.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/dataclass/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/dataclass/dataclass_abstract.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/dataclass/dataclass_core.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/validation/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/validation/validation.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/validation/validation_abstract.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/validation/validation_polars.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/validation/validation_utils.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/_async_logger.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/_base.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/_internal.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/_internal_logger.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/_logger_interface.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/handlers/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/handlers/datadog_api_handler.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/handlers/safe_stream_handler.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/models/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/models/_log_level.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/models/_logs_metadata.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/providers/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/logs/providers/void_logger.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/metrics/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/metrics/_base.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/metrics/providers/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/metrics/providers/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/metrics/providers/datadog_provider.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/metrics/providers/void_provider.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/ml/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/ml/_model.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/ml/mlflow/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/ml/mlflow/_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/ml/mlflow/_functions.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/process_communication/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/process_communication/_models.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/schema_management/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/schema_management/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/schema_management/schema_entity.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/_azure_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/_base.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/_local_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/aws/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/aws/_aws_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/aws/_aws_credentials.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/hashicorp_vault/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/hashicorp_vault/hashicorp_vault_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/hashicorp_vault/kubernetes_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/hashicorp_vault/oidc_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/security/clients/hashicorp_vault/token_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/blob/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/blob/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/blob/azure_storage_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/blob/base.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/blob/local_storage_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/blob/s3_storage_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/cache/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/cache/_base.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/cache/redis_cache.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/v3/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/v3/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/v3/azure_sql.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/v3/models/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/v3/models/_models.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/v3/odbc.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/v3/snowflake_sql.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/database/v3/trino_sql.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/delta_lake/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/delta_lake/v3/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/delta_lake/v3/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/delta_lake/v3/_functions.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/delta_lake/v3/_models.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/keyspace_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/aws_keyspaces/keyspaces-certificate.pem +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/cassandra_client/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/cassandra_client/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/cassandra_client/_client_configuration.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/cassandra_client/_model_mappers.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/datastax_astra/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/datastax_astra/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/datastax_astra/_models.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/datastax_astra/astra_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/vanilla_cassandra/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/vanilla_cassandra/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/distributed_object_store/v3/vanilla_cassandra/vanilla_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/exceptions.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/iceberg/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/iceberg/v1/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/iceberg/v1/_functions.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/iceberg/v1/_models.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/_functions.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/astra.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/aws.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/azure.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/base.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/cassandra.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/enum.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/expression_dsl/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/expression_dsl/arrow_filter_expression.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/expression_dsl/cassandra_filter_expression.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/expression_dsl/filter_expression.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/expression_dsl/iceberg_filter_expression.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/expression_dsl/trino_filter_expression.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/format.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/formatters/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/formatters/dict.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/formatters/exceptions.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/formatters/metaframe.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/formatters/pandas.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/formatters/pickle.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/formatters/polars.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/formatters/unit.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/hive.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/iceberg.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/local.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/trino.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/_functions.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/_models.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/_qes_astra.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/_qes_cassandra.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/_qes_delta.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/_qes_iceberg.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/_qes_local.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/_qes_trino.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/parameters/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/parameters/_base.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/parameters/_read_parameters.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/parameters/_write_parameters.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/secrets/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/secrets/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/secrets/_base.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/secrets/azure_secret_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/secrets/hashicorp_vault_secret_storage_client.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/sync/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/README.md +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/_common.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/_requests.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/concurrent_task_runner.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/data_structures/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/data_structures/_functions.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/decorators/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/decorators/_logging.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/decorators/_rate_limit.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/metaframe.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/polars.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/src/adapta/utils/python_typing/__init__.py +0 -0
- {adapta-5.3.6 → adapta-5.3.7}/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.
|
|
3
|
+
Version: 5.3.7
|
|
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.
|
|
3
|
+
version = "5.3.7"
|
|
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"
|
|
@@ -100,15 +100,23 @@ def _cache_lazyframe(lazy_source: polars.LazyFrame) -> polars.LazyFrame:
|
|
|
100
100
|
return polars.scan_ipc(tmp_path)
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
def _shard_source(
|
|
103
|
+
def _shard_source(
|
|
104
|
+
lazy_source: polars.LazyFrame,
|
|
105
|
+
shard_count: int,
|
|
106
|
+
primary_keys: list[str],
|
|
107
|
+
) -> list[polars.LazyFrame]:
|
|
104
108
|
"""
|
|
105
|
-
Splits a Polars LazyFrame into shard_count buckets using the
|
|
109
|
+
Splits a Polars LazyFrame into shard_count buckets using a hash of the primary key columns.
|
|
106
110
|
"""
|
|
111
|
+
if not primary_keys:
|
|
112
|
+
raise ValueError("At least one primary key is required for sharded operations (shard_count > 1)")
|
|
113
|
+
|
|
107
114
|
schema = lazy_source.collect_schema()
|
|
108
|
-
if
|
|
109
|
-
|
|
115
|
+
missing_keys = [pk for pk in primary_keys if pk not in schema]
|
|
116
|
+
if missing_keys:
|
|
117
|
+
raise ValueError(f"Primary key columns {missing_keys} are missing from source")
|
|
110
118
|
|
|
111
|
-
bucket_expr = polars.
|
|
119
|
+
bucket_expr = polars.struct(sorted(primary_keys)).hash() % shard_count
|
|
112
120
|
|
|
113
121
|
cached_source = _cache_lazyframe(lazy_source)
|
|
114
122
|
source_with_bucket = cached_source.with_columns(bucket_expr.alias("__bucket"))
|
|
@@ -754,6 +762,22 @@ class CassandraClient(ABC):
|
|
|
754
762
|
:param keyspace: Optional keyspace name, if not provided in the client constructor.
|
|
755
763
|
:param concurrency: Maximum number of concurrent statements. Defaults to cpu_count * 2.
|
|
756
764
|
"""
|
|
765
|
+
|
|
766
|
+
@on_exception(
|
|
767
|
+
wait_gen=expo,
|
|
768
|
+
exception=(OverloadedErrorMessage, IsBootstrappingErrorMessage, WriteTimeout, WriteFailure),
|
|
769
|
+
max_tries=self._client_config.transient_error_max_retries,
|
|
770
|
+
max_time=self._client_config.transient_error_max_wait_s,
|
|
771
|
+
max_value=self._client_config.transient_error_max_wait_s_per_retry,
|
|
772
|
+
raise_on_giveup=True,
|
|
773
|
+
)
|
|
774
|
+
def _execute_concurrent(statements: list[tuple[PreparedStatement, tuple]], target_concurrency: int):
|
|
775
|
+
execute_concurrent(
|
|
776
|
+
self._session,
|
|
777
|
+
statements,
|
|
778
|
+
concurrency=target_concurrency,
|
|
779
|
+
)
|
|
780
|
+
|
|
757
781
|
assert self._session is not None, (
|
|
758
782
|
"Please connect to Cassandra using connect() or with CassandraClient(...) before calling this method"
|
|
759
783
|
)
|
|
@@ -779,22 +803,7 @@ class CassandraClient(ABC):
|
|
|
779
803
|
|
|
780
804
|
concurrency = concurrency or (os.cpu_count() or 1) * 2
|
|
781
805
|
|
|
782
|
-
|
|
783
|
-
wait_gen=expo,
|
|
784
|
-
exception=(OverloadedErrorMessage, IsBootstrappingErrorMessage, WriteTimeout, WriteFailure),
|
|
785
|
-
max_tries=self._client_config.transient_error_max_retries,
|
|
786
|
-
max_time=self._client_config.transient_error_max_wait_s,
|
|
787
|
-
max_value=self._client_config.transient_error_max_wait_s_per_retry,
|
|
788
|
-
raise_on_giveup=True,
|
|
789
|
-
)
|
|
790
|
-
def _execute_concurrent():
|
|
791
|
-
execute_concurrent(
|
|
792
|
-
self._session,
|
|
793
|
-
statements_and_params,
|
|
794
|
-
concurrency=concurrency,
|
|
795
|
-
)
|
|
796
|
-
|
|
797
|
-
_execute_concurrent()
|
|
806
|
+
_execute_concurrent(statements_and_params, concurrency)
|
|
798
807
|
|
|
799
808
|
def upload_concurrent_native(
|
|
800
809
|
self,
|
|
@@ -818,20 +827,10 @@ class CassandraClient(ABC):
|
|
|
818
827
|
:param keyspace: Optional keyspace name, if not provided in the client constructor.
|
|
819
828
|
:param batch_size: Number of rows per batch to collect and upsert. Defaults to 100,000.
|
|
820
829
|
:param threads: Maximum number of concurrent statements per batch.
|
|
821
|
-
:param shard_count: Number of shards to split rows into for parallel upload. When specified (>1), rows are split into buckets by
|
|
830
|
+
:param shard_count: Number of shards to split rows into for parallel upload. When specified (>1), rows are split into buckets by a hash of primary key fields and uploaded concurrently using ConcurrentTaskRunner.
|
|
822
831
|
:param shard_id: Optional specific shard index (0-based) to upload. When specified, only this shard is uploaded to {table_name}_{shard_id}.
|
|
823
832
|
:return: Total number of rows upserted.
|
|
824
833
|
"""
|
|
825
|
-
if shard_count is not None and shard_count <= 0:
|
|
826
|
-
raise ValueError("shard_count must be greater than 0")
|
|
827
|
-
|
|
828
|
-
if shard_id is not None:
|
|
829
|
-
if shard_count is None:
|
|
830
|
-
raise ValueError("shard_count must be specified when shard_id is provided")
|
|
831
|
-
if shard_id < 0 or shard_id >= shard_count:
|
|
832
|
-
raise ValueError(f"shard_id must be between 0 and {shard_count - 1}")
|
|
833
|
-
|
|
834
|
-
lazy_source = _prepare_lazy_source(source)
|
|
835
834
|
|
|
836
835
|
@run_time_metrics(metric_name="adapta.cassandra.iceberg_batch_upsert_duration")
|
|
837
836
|
def _upsert_with_metric(entities: list[dict] | polars.LazyFrame, **kwargs) -> int:
|
|
@@ -854,7 +853,7 @@ class CassandraClient(ABC):
|
|
|
854
853
|
batch.lazy(),
|
|
855
854
|
table_name=target_table,
|
|
856
855
|
entity_type=entity_type,
|
|
857
|
-
keyspace=keyspace,
|
|
856
|
+
keyspace=keyspace or self._keyspace,
|
|
858
857
|
concurrency=threads,
|
|
859
858
|
row_count=batch.height,
|
|
860
859
|
metrics_provider=self._metrics_provider,
|
|
@@ -863,8 +862,26 @@ class CassandraClient(ABC):
|
|
|
863
862
|
total += batch.height
|
|
864
863
|
return total
|
|
865
864
|
|
|
865
|
+
if shard_count is not None and shard_count <= 0:
|
|
866
|
+
raise ValueError("shard_count must be greater than 0")
|
|
867
|
+
|
|
868
|
+
if shard_id is not None:
|
|
869
|
+
if shard_count is None:
|
|
870
|
+
raise ValueError("shard_count must be specified when shard_id is provided")
|
|
871
|
+
if shard_id < 0 or shard_id >= shard_count:
|
|
872
|
+
raise ValueError(f"shard_id must be between 0 and {shard_count - 1}")
|
|
873
|
+
|
|
874
|
+
lazy_source = _prepare_lazy_source(source)
|
|
875
|
+
|
|
876
|
+
cassandra_mapper = get_mapper(
|
|
877
|
+
data_model=entity_type,
|
|
878
|
+
table_name=table_name,
|
|
879
|
+
keyspace=keyspace or self._keyspace,
|
|
880
|
+
)
|
|
881
|
+
primary_keys = cassandra_mapper.primary_keys
|
|
882
|
+
|
|
866
883
|
if shard_count and shard_count > 1:
|
|
867
|
-
shards = _shard_source(lazy_source, shard_count)
|
|
884
|
+
shards = _shard_source(lazy_source, shard_count, primary_keys)
|
|
868
885
|
if shard_id is not None:
|
|
869
886
|
return _upload_batches(shards[shard_id], f"{table_name}_{shard_id}")
|
|
870
887
|
|
|
@@ -905,7 +922,7 @@ class CassandraClient(ABC):
|
|
|
905
922
|
:param keyspace: Optional keyspace name, if not provided in the client constructor.
|
|
906
923
|
:param batch_size: Number of rows per batch to collect and upsert. Defaults to 1,000.
|
|
907
924
|
:param threads: Number of parallel threads to use. Defaults to 4.
|
|
908
|
-
:param shard_count: Number of shards to split rows into for parallel upload. When specified (>1), rows are split into buckets by
|
|
925
|
+
:param shard_count: Number of shards to split rows into for parallel upload. When specified (>1), rows are split into buckets by a hash of primary key fields and uploaded concurrently using ConcurrentTaskRunner.
|
|
909
926
|
:param shard_id: Optional specific shard index (0-based) to upload. When specified, only this shard is uploaded to {table_name}_{shard_id}.
|
|
910
927
|
"""
|
|
911
928
|
|
|
@@ -948,8 +965,15 @@ class CassandraClient(ABC):
|
|
|
948
965
|
|
|
949
966
|
lazy_source = _prepare_lazy_source(source)
|
|
950
967
|
|
|
968
|
+
cassandra_mapper = get_mapper(
|
|
969
|
+
data_model=entity_type,
|
|
970
|
+
table_name=table_name,
|
|
971
|
+
keyspace=keyspace or self._keyspace,
|
|
972
|
+
)
|
|
973
|
+
primary_keys = cassandra_mapper.primary_keys
|
|
974
|
+
|
|
951
975
|
if shard_count and shard_count > 1:
|
|
952
|
-
shards = _shard_source(lazy_source, shard_count)
|
|
976
|
+
shards = _shard_source(lazy_source, shard_count, primary_keys)
|
|
953
977
|
if shard_id is not None:
|
|
954
978
|
return _upload_shard(shards[shard_id], f"{table_name}_{shard_id}")
|
|
955
979
|
|
|
@@ -1032,7 +1056,7 @@ class CassandraClient(ABC):
|
|
|
1032
1056
|
_delete_with_metric(
|
|
1033
1057
|
source_batch.to_dicts(),
|
|
1034
1058
|
entity_type=entity_type,
|
|
1035
|
-
keyspace=
|
|
1059
|
+
keyspace=keyspace or self._keyspace,
|
|
1036
1060
|
table_name=target_table,
|
|
1037
1061
|
primary_keys=target_pks,
|
|
1038
1062
|
metrics_provider=self._metrics_provider,
|
|
@@ -1041,8 +1065,6 @@ class CassandraClient(ABC):
|
|
|
1041
1065
|
shard_rows += source_batch.height
|
|
1042
1066
|
return shard_rows
|
|
1043
1067
|
|
|
1044
|
-
target_keyspace = keyspace or self._keyspace
|
|
1045
|
-
|
|
1046
1068
|
if shard_count is not None and shard_count <= 0:
|
|
1047
1069
|
raise ValueError("shard_count must be greater than 0")
|
|
1048
1070
|
|
|
@@ -1057,24 +1079,23 @@ class CassandraClient(ABC):
|
|
|
1057
1079
|
cassandra_mapper = get_mapper(
|
|
1058
1080
|
data_model=entity_type,
|
|
1059
1081
|
table_name=table_name,
|
|
1060
|
-
keyspace=
|
|
1082
|
+
keyspace=keyspace or self._keyspace,
|
|
1061
1083
|
)
|
|
1062
1084
|
primary_keys = cassandra_mapper.primary_keys
|
|
1063
1085
|
|
|
1064
1086
|
if shard_count and shard_count > 1:
|
|
1087
|
+
shards = _shard_source(lazy_source, shard_count, primary_keys)
|
|
1065
1088
|
if shard_id is not None:
|
|
1066
|
-
return _delete_shard(
|
|
1067
|
-
|
|
1068
|
-
lazy_source = _cache_lazyframe(lazy_source)
|
|
1089
|
+
return _delete_shard(shards[shard_id], f"{table_name}_{shard_id}", primary_keys)
|
|
1069
1090
|
|
|
1070
1091
|
ctr = ConcurrentTaskRunner[int](
|
|
1071
1092
|
[
|
|
1072
1093
|
Executable(
|
|
1073
1094
|
_delete_shard,
|
|
1074
1095
|
str(uuid.uuid4()),
|
|
1075
|
-
args=[
|
|
1096
|
+
args=[shard, f"{table_name}_{i}", primary_keys],
|
|
1076
1097
|
)
|
|
1077
|
-
for i in
|
|
1098
|
+
for i, shard in enumerate(shards)
|
|
1078
1099
|
],
|
|
1079
1100
|
num_threads=shard_count,
|
|
1080
1101
|
)
|
|
@@ -1088,7 +1109,7 @@ class CassandraClient(ABC):
|
|
|
1088
1109
|
kwargs={
|
|
1089
1110
|
"entities": source_batch.to_dicts(),
|
|
1090
1111
|
"entity_type": entity_type,
|
|
1091
|
-
"keyspace":
|
|
1112
|
+
"keyspace": keyspace or self._keyspace,
|
|
1092
1113
|
"table_name": table_name,
|
|
1093
1114
|
"primary_keys": primary_keys,
|
|
1094
1115
|
"metrics_provider": self._metrics_provider,
|
|
@@ -93,10 +93,6 @@ class CustomIndexMetadata:
|
|
|
93
93
|
if ver_field and ver_field.name != index_field.name:
|
|
94
94
|
fields_spec.append((ver_field.name, ver_field.type, dataclasses.field()))
|
|
95
95
|
|
|
96
|
-
rowhash_field = model_fields.get("rowhash")
|
|
97
|
-
if rowhash_field and rowhash_field.name not in [f[0] for f in fields_spec]:
|
|
98
|
-
fields_spec.append((rowhash_field.name, rowhash_field.type, dataclasses.field()))
|
|
99
|
-
|
|
100
96
|
return cls(
|
|
101
97
|
index_model=dataclasses.make_dataclass(f"{base_model.__name__}__idx_{index_field.name}", fields_spec),
|
|
102
98
|
field_name=index_field.name,
|
|
@@ -305,17 +301,19 @@ def sync_iceberg_to_cassandra(
|
|
|
305
301
|
"""
|
|
306
302
|
Synchronizes data from the provided Iceberg source to Cassandra target table. Assumes schemas are compatible.
|
|
307
303
|
"""
|
|
308
|
-
source_path: IcebergPath = iceberg_source.parse_data_path()
|
|
309
|
-
target_path: CassandraPath = cassandra_target.parse_data_path()
|
|
310
|
-
cassandra_model = target_path.model_class()
|
|
311
304
|
|
|
312
|
-
def _sync_lazyframe(
|
|
305
|
+
def _sync_lazyframe(
|
|
306
|
+
source: LazyFrame,
|
|
307
|
+
target_table: str,
|
|
308
|
+
target_model: type[TCassandraModel],
|
|
309
|
+
keyspace: str,
|
|
310
|
+
) -> int:
|
|
313
311
|
if upload_mode == CassandraUploadMode.CONCURRENT_BATCH:
|
|
314
312
|
return client.upload_concurrent_batch(
|
|
315
313
|
source=source,
|
|
316
|
-
table_name=
|
|
317
|
-
entity_type=
|
|
318
|
-
keyspace=
|
|
314
|
+
table_name=target_table,
|
|
315
|
+
entity_type=target_model,
|
|
316
|
+
keyspace=keyspace,
|
|
319
317
|
batch_size=read_chunk_size,
|
|
320
318
|
threads=threads,
|
|
321
319
|
shard_count=shard_count,
|
|
@@ -324,9 +322,9 @@ def sync_iceberg_to_cassandra(
|
|
|
324
322
|
if upload_mode == CassandraUploadMode.CONCURRENT_NATIVE:
|
|
325
323
|
return client.upload_concurrent_native(
|
|
326
324
|
source=source,
|
|
327
|
-
table_name=
|
|
328
|
-
entity_type=
|
|
329
|
-
keyspace=
|
|
325
|
+
table_name=target_table,
|
|
326
|
+
entity_type=target_model,
|
|
327
|
+
keyspace=keyspace,
|
|
330
328
|
batch_size=read_chunk_size,
|
|
331
329
|
threads=threads,
|
|
332
330
|
shard_count=shard_count,
|
|
@@ -334,18 +332,27 @@ def sync_iceberg_to_cassandra(
|
|
|
334
332
|
)
|
|
335
333
|
raise ValueError(f"Unsupported upload mode: {upload_mode}")
|
|
336
334
|
|
|
337
|
-
def _sync_deletes(
|
|
335
|
+
def _sync_deletes(
|
|
336
|
+
source: LazyFrame,
|
|
337
|
+
target_table: str,
|
|
338
|
+
target_model: type[TCassandraModel],
|
|
339
|
+
keyspace: str,
|
|
340
|
+
) -> int:
|
|
338
341
|
return client.delete_batch_concurrent(
|
|
339
342
|
source=source,
|
|
340
|
-
table_name=
|
|
341
|
-
entity_type=
|
|
342
|
-
keyspace=
|
|
343
|
+
table_name=target_table,
|
|
344
|
+
entity_type=target_model,
|
|
345
|
+
keyspace=keyspace,
|
|
343
346
|
batch_size=read_chunk_size,
|
|
344
347
|
threads=threads,
|
|
345
348
|
shard_count=shard_count,
|
|
346
349
|
shard_id=shard_id,
|
|
347
350
|
)
|
|
348
351
|
|
|
352
|
+
source_path: IcebergPath = iceberg_source.parse_data_path()
|
|
353
|
+
target_path: CassandraPath = cassandra_target.parse_data_path()
|
|
354
|
+
cassandra_model = target_path.model_class()
|
|
355
|
+
|
|
349
356
|
logger.info(
|
|
350
357
|
"Running incremental sync to table {sync_to_table}. Looking for changes to sync.",
|
|
351
358
|
sync_to_table=target_path.table,
|
|
@@ -383,7 +390,12 @@ def sync_iceberg_to_cassandra(
|
|
|
383
390
|
iceberg_catalog,
|
|
384
391
|
lazy_read=True,
|
|
385
392
|
).to_polars()
|
|
386
|
-
total_synced_records = _sync_lazyframe(
|
|
393
|
+
total_synced_records = _sync_lazyframe(
|
|
394
|
+
source_data,
|
|
395
|
+
target_path.table,
|
|
396
|
+
cassandra_model,
|
|
397
|
+
target_path.keyspace,
|
|
398
|
+
)
|
|
387
399
|
elif int(last_synced_snapshot) != current_snapshot:
|
|
388
400
|
logger.info(
|
|
389
401
|
"Last sync snapshot: {snapshot}. Performing incremental sync to {latest_snapshot}",
|
|
@@ -400,12 +412,27 @@ def sync_iceberg_to_cassandra(
|
|
|
400
412
|
primary_key_columns=tuple(mapper.primary_keys),
|
|
401
413
|
)
|
|
402
414
|
# insert/update first
|
|
403
|
-
total_synced_records += _sync_lazyframe(
|
|
415
|
+
total_synced_records += _sync_lazyframe(
|
|
416
|
+
inserts,
|
|
417
|
+
target_path.table,
|
|
418
|
+
cassandra_model,
|
|
419
|
+
target_path.keyspace,
|
|
420
|
+
)
|
|
404
421
|
if updates is not None:
|
|
405
|
-
total_synced_records += _sync_lazyframe(
|
|
422
|
+
total_synced_records += _sync_lazyframe(
|
|
423
|
+
updates,
|
|
424
|
+
target_path.table,
|
|
425
|
+
cassandra_model,
|
|
426
|
+
target_path.keyspace,
|
|
427
|
+
)
|
|
406
428
|
# keep deletes out of parallelism for now
|
|
407
429
|
if deletes is not None:
|
|
408
|
-
total_synced_records += _sync_deletes(
|
|
430
|
+
total_synced_records += _sync_deletes(
|
|
431
|
+
deletes,
|
|
432
|
+
target_path.table,
|
|
433
|
+
cassandra_model,
|
|
434
|
+
target_path.keyspace,
|
|
435
|
+
)
|
|
409
436
|
else:
|
|
410
437
|
logger.info(
|
|
411
438
|
"Table {target} is already up to date with {source} at snapshot {snapshot}",
|
|
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.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/dataclass/dataclass_abstract.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/validation/validation_abstract.py
RENAMED
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/src/adapta/dataclass_validation/validation/validation_polars.py
RENAMED
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/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.3.6 → adapta-5.3.7}/src/adapta/security/clients/hashicorp_vault/hashicorp_vault_client.py
RENAMED
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/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.3.6 → adapta-5.3.7}/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
|
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/expression_dsl/arrow_filter_expression.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/models/expression_dsl/iceberg_filter_expression.py
RENAMED
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/src/adapta/storage/query_enabled_store/parameters/_read_parameters.py
RENAMED
|
File without changes
|
{adapta-5.3.6 → adapta-5.3.7}/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.3.6 → adapta-5.3.7}/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
|