fdc-shared-kernel 0.0.194__tar.gz → 0.0.196__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.
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/PKG-INFO +2 -1
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/fdc_shared_kernel.egg-info/PKG-INFO +2 -1
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/fdc_shared_kernel.egg-info/SOURCES.txt +3 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/fdc_shared_kernel.egg-info/requires.txt +1 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/pyproject.toml +1 -1
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/requirements.txt +1 -0
- fdc_shared_kernel-0.0.196/shared_kernel/data_warehouse_handlers/base_executor.py +101 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/connections/databricks_warehouse_connection.py +2 -1
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/connections/fabric_sql_warehouse_connection.py +5 -3
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/connections/jdbc_warehouse_connection.py +2 -1
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/connections/mssql_warehouse_connection.py +5 -2
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/connections/mysql_warehouse_connection.py +4 -2
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/connections/postgresql_warehouse_connection.py +4 -2
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/connections/redshift_warehouse_connection.py +4 -2
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/connections/snowflake_warehouse_connection.py +2 -1
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/query_executors/databricks_query_executor.py +18 -2
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/query_executors/fabric_sql_query_executor.py +20 -12
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/query_executors/jdbc_query_executor.py +20 -2
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/query_executors/mssql_query_executor.py +20 -12
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/query_executors/mysql_query_executor.py +20 -12
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/query_executors/postgresql_query_executor.py +21 -13
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/query_executors/redshift_query_executor.py +79 -51
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/query_executors/snowflake_query_executor.py +20 -8
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/operational_exceptions.py +14 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/query_executor.py +8 -2
- fdc_shared_kernel-0.0.196/shared_kernel/interfaces/warehouse_connection.py +157 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/logger/__init__.py +22 -1
- fdc_shared_kernel-0.0.196/shared_kernel/utils/logging_utils.py +174 -0
- fdc_shared_kernel-0.0.196/shared_kernel/utils/request_id.py +61 -0
- fdc_shared_kernel-0.0.194/shared_kernel/interfaces/warehouse_connection.py +0 -27
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/README.md +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/README_pypi.md +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/fdc_shared_kernel.egg-info/dependency_links.txt +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/fdc_shared_kernel.egg-info/top_level.txt +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/setup.cfg +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/agent_communication_channel/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/agent_communication_channel/agent_channel.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/agent_communication_channel/contexts.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/agent_communication_channel/event_channel.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/ai_audit_log/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/ai_chat_persistence/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/ai_chat_persistence/chat_persistence.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/async_task_executor/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/async_task_executor/async_task_executor.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/auth/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/auth/jwt_helper.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/auth/token_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/auth/workbook_permission_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/batch_job_status_tracker/container_job_status_tracker.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_handlers/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_handlers/aws_batch_job_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_handlers/azure_apps_job_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_handlers/job_handler_factory.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_handlers/job_status_mapper.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_storage_managers/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_storage_managers/azure_blob_storage_manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_storage_managers/job_storage_manager_factory.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/batch_job/job_storage_managers/s3_job_storage_manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/config/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/constants/constants.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/custom_query_builders/databricks_query.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/databricks_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/fabric_sql_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/factory.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/jdbc_driver_registry.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/jdbc_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/mssql_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/mysql_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/odbc_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/postgresql_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/redshift_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/snowflake_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/data_warehouse_handlers/warehouse_handlers_map.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/database/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/dataclasses/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/dataclasses/aws_batch_job_context.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/dataclasses/azure_container_app_job_context.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/dataclasses/event_executor.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/dataclasses/job_context.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/dataclasses/job_record_dataclasses.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/dataclasses/warehouse_configs.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/csv.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/databricks.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/db2.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/jdbc.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/jira.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/mssql.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/mysql.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/oracle.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/postgres.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/redshift.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/salesforce.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/snowflake.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/connectors_to_system/sqlalchemy.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/system_to_warehouse/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/system_to_warehouse/postgres.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/datatype_mappings/system_to_warehouse/redshift.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/enums/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/enums/async_task_executor.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/enums/connection_engine.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/enums/status_tracker.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/event_executor/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/event_executor/event_executor.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/event_executor/job_executor.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/event_executor/utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/batch_job_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/configuration_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/custom_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/data_validation_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/http_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/infrastructure_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/security_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/exceptions/user_intervention_exception.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/http/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/http/httpx_http_client.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/http/request_http_client.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/base_job_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/data_warehouse_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/databus.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/encryption.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/http.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/keyvault.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/interfaces/storage_manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/aws_databus.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/azure_databus.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/http_databus.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/nats_databus.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/nats_publisher.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/nats_test.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/utils/aws_utility.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/utils/azure_utility.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/messaging/utils/event_messages.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/metrics/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/metrics/status_tracker.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/models/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/registries/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/registries/schema_onboarding_event_registry.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/registries/service_event_registry.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/base_tracker.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/enums.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/exceptions.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/run_manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/schema_onboarding_tracker.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/shared_helpers.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/task_determination.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/task_helpers.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/task_manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/template_manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/schema_onboarding_tracker/utility_manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/security/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/security/encryption/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/security/encryption/manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/security/encryption/providers.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/security/key_vault/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/security/key_vault/aws_secret_manager.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/security/key_vault/azure_keyvault.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/status_tracker/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/status_tracker/status_tracker.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/storage_handlers/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/storage_handlers/blob_file_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/storage_handlers/s3_storage_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/config/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/config/test_config.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/logger/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/logger/test_logger.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/messaging/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/messaging/test_aws_databus.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/messaging/test_event_executor.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/messaging/test_nats_interface.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/security/test_encryption.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/utils/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/utils/test_data_validators.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/utils/test_date_format_utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/tests/utils/test_string_utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/traceability/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/traceability/traceability_handler.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/data_validators_utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/date_format_utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/date_utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/string_utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/template_renderer.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/thread_debug_utils.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/thread_local_storage.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/shared_kernel/utils/thread_log_traker.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/tests/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/tests/messaging/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/tests/messaging/utils/__init__.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/tests/messaging/utils/test_aws_utility.py +0 -0
- {fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/tests/test_job_executor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fdc_shared_kernel
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.196
|
|
4
4
|
Summary: Shared library for microservice
|
|
5
5
|
Author-email: Shikhil S <shikhil.s@dbizsolution.com>, Ahammed Akdham N <ahammedakdham.n@dbizsolution.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -47,6 +47,7 @@ Requires-Dist: snowflake-connector-python==3.16.0
|
|
|
47
47
|
Requires-Dist: PyMySQL==1.1.1
|
|
48
48
|
Requires-Dist: jaydebeapi==1.2.3
|
|
49
49
|
Requires-Dist: JPype1==1.5.0
|
|
50
|
+
Requires-Dist: psutil==6.0.0
|
|
50
51
|
|
|
51
52
|
# FDC Shared Kernel
|
|
52
53
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fdc_shared_kernel
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.196
|
|
4
4
|
Summary: Shared library for microservice
|
|
5
5
|
Author-email: Shikhil S <shikhil.s@dbizsolution.com>, Ahammed Akdham N <ahammedakdham.n@dbizsolution.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -47,6 +47,7 @@ Requires-Dist: snowflake-connector-python==3.16.0
|
|
|
47
47
|
Requires-Dist: PyMySQL==1.1.1
|
|
48
48
|
Requires-Dist: jaydebeapi==1.2.3
|
|
49
49
|
Requires-Dist: JPype1==1.5.0
|
|
50
|
+
Requires-Dist: psutil==6.0.0
|
|
50
51
|
|
|
51
52
|
# FDC Shared Kernel
|
|
52
53
|
|
{fdc_shared_kernel-0.0.194 → fdc_shared_kernel-0.0.196}/fdc_shared_kernel.egg-info/SOURCES.txt
RENAMED
|
@@ -35,6 +35,7 @@ shared_kernel/batch_job/job_storage_managers/s3_job_storage_manager.py
|
|
|
35
35
|
shared_kernel/config/__init__.py
|
|
36
36
|
shared_kernel/constants/constants.py
|
|
37
37
|
shared_kernel/data_warehouse_handlers/__init__.py
|
|
38
|
+
shared_kernel/data_warehouse_handlers/base_executor.py
|
|
38
39
|
shared_kernel/data_warehouse_handlers/databricks_handler.py
|
|
39
40
|
shared_kernel/data_warehouse_handlers/fabric_sql_handler.py
|
|
40
41
|
shared_kernel/data_warehouse_handlers/factory.py
|
|
@@ -183,6 +184,8 @@ shared_kernel/utils/__init__.py
|
|
|
183
184
|
shared_kernel/utils/data_validators_utils.py
|
|
184
185
|
shared_kernel/utils/date_format_utils.py
|
|
185
186
|
shared_kernel/utils/date_utils.py
|
|
187
|
+
shared_kernel/utils/logging_utils.py
|
|
188
|
+
shared_kernel/utils/request_id.py
|
|
186
189
|
shared_kernel/utils/string_utils.py
|
|
187
190
|
shared_kernel/utils/template_renderer.py
|
|
188
191
|
shared_kernel/utils/thread_debug_utils.py
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
from abc import ABC
|
|
2
|
+
from functools import wraps
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
from shared_kernel.exceptions.operational_exceptions import QueryCancelledException
|
|
6
|
+
from shared_kernel.interfaces.query_executor import DataWarehouseQueryExecutor
|
|
7
|
+
from shared_kernel.utils.logging_utils import is_request_cancelled
|
|
8
|
+
from shared_kernel.utils.request_id import get_request_id
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
def cancel_check(func):
|
|
13
|
+
"""
|
|
14
|
+
Decorator to wrap query executor execution methods with cancellation checks.
|
|
15
|
+
|
|
16
|
+
RATIONALE:
|
|
17
|
+
When applied to execution methods (e.g. execute_query), it checks if the
|
|
18
|
+
request has already been cancelled before sending the query to the warehouse.
|
|
19
|
+
It also propagates the distributed request tracing context (request_id) to the executor.
|
|
20
|
+
"""
|
|
21
|
+
@wraps(func)
|
|
22
|
+
def wrapper(self, *args, **kwargs):
|
|
23
|
+
# Capture request ID from the calling thread and store it on self
|
|
24
|
+
req_id = getattr(self, "request_id", None)
|
|
25
|
+
if not req_id:
|
|
26
|
+
req_id = get_request_id()
|
|
27
|
+
if req_id:
|
|
28
|
+
self.request_id = req_id
|
|
29
|
+
|
|
30
|
+
self.check_cancelled()
|
|
31
|
+
return func(self, *args, **kwargs)
|
|
32
|
+
return wrapper
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class BaseQueryExecutor(DataWarehouseQueryExecutor, ABC):
|
|
36
|
+
"""
|
|
37
|
+
Base implementation of DataWarehouseQueryExecutor that handles
|
|
38
|
+
automatic query cancellation checks and raw connection cancellation logic.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def check_cancelled(self) -> None:
|
|
42
|
+
"""
|
|
43
|
+
Checks if the current request has been cancelled, and raises an exception if so.
|
|
44
|
+
"""
|
|
45
|
+
req_id = getattr(self, "request_id", None)
|
|
46
|
+
if not req_id:
|
|
47
|
+
req_id = get_request_id()
|
|
48
|
+
|
|
49
|
+
if req_id and is_request_cancelled(req_id):
|
|
50
|
+
logger.warning(f"[REQ_ID: {req_id}] Aborting query execution due to client disconnect.")
|
|
51
|
+
raise QueryCancelledException("Query execution aborted due to client disconnect.")
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def active_connections(self) -> set:
|
|
55
|
+
if not hasattr(self, '_active_connections'):
|
|
56
|
+
self._active_connections = set()
|
|
57
|
+
return self._active_connections
|
|
58
|
+
|
|
59
|
+
def _cancel_connection(self, conn) -> None:
|
|
60
|
+
"""
|
|
61
|
+
Generic helper to cancel an individual active connection.
|
|
62
|
+
Handles SQLAlchemy connection wrappers, DBAPI connections, and fallback logic.
|
|
63
|
+
|
|
64
|
+
RATIONALE:
|
|
65
|
+
1. We attempt to invoke driver-native cancel() (e.g. raw_conn.cancel()) which cancels the
|
|
66
|
+
active query safely on the database server.
|
|
67
|
+
2. If native cancel is not supported by the driver, we log a warning and DO NOTHING (pass).
|
|
68
|
+
This allows the query to run to completion or fail gracefully on timeout, ensuring the
|
|
69
|
+
connection remains in a healthy state and is safely returned back to the pool.
|
|
70
|
+
"""
|
|
71
|
+
cancelled = False
|
|
72
|
+
try:
|
|
73
|
+
raw_conn = None
|
|
74
|
+
if hasattr(conn, 'connection') and conn.connection:
|
|
75
|
+
# conn.connection is typically a _ConnectionFairy in SQLAlchemy
|
|
76
|
+
fairy = conn.connection
|
|
77
|
+
if hasattr(fairy, 'dbapi_connection') and fairy.dbapi_connection:
|
|
78
|
+
raw_conn = fairy.dbapi_connection
|
|
79
|
+
elif hasattr(fairy, 'connection') and fairy.connection:
|
|
80
|
+
raw_conn = fairy.connection
|
|
81
|
+
else:
|
|
82
|
+
raw_conn = fairy
|
|
83
|
+
elif hasattr(conn, 'dbapi_connection') and conn.dbapi_connection:
|
|
84
|
+
raw_conn = conn.dbapi_connection
|
|
85
|
+
else:
|
|
86
|
+
raw_conn = conn
|
|
87
|
+
|
|
88
|
+
if raw_conn and hasattr(raw_conn, 'cancel'):
|
|
89
|
+
logger.info("Calling driver-level cancel() on raw connection.")
|
|
90
|
+
raw_conn.cancel()
|
|
91
|
+
cancelled = True
|
|
92
|
+
elif hasattr(conn, 'cancel'):
|
|
93
|
+
logger.info("Calling cancel() on connection.")
|
|
94
|
+
conn.cancel()
|
|
95
|
+
cancelled = True
|
|
96
|
+
except Exception as cancel_err:
|
|
97
|
+
logger.error(f"Error calling driver-level cancel: {cancel_err}")
|
|
98
|
+
|
|
99
|
+
if not cancelled:
|
|
100
|
+
logger.warning("Driver does not support cancel(). Doing nothing.")
|
|
101
|
+
pass
|
|
@@ -7,7 +7,7 @@ from databricks.sql.exc import InterfaceError, OperationalError, ProgrammingErro
|
|
|
7
7
|
|
|
8
8
|
from shared_kernel.dataclasses.warehouse_configs import DatabricksConfig
|
|
9
9
|
from shared_kernel.exceptions.http_exceptions import BadRequest
|
|
10
|
-
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
10
|
+
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection, cancel_check_connection
|
|
11
11
|
from shared_kernel.logger import Logger
|
|
12
12
|
from shared_kernel.config import Config
|
|
13
13
|
|
|
@@ -88,6 +88,7 @@ class DatabricksWarehouseConnection(DataWarehouseConnection):
|
|
|
88
88
|
self.close_connection()
|
|
89
89
|
|
|
90
90
|
@contextmanager
|
|
91
|
+
@cancel_check_connection
|
|
91
92
|
def get_connection(self, retries: int = 3, delay: int = 5, query_timeout: int = 30):
|
|
92
93
|
if not (self._conn and self.is_valid_connection()):
|
|
93
94
|
self._create_connection_with_retry(retries, delay)
|
|
@@ -14,7 +14,7 @@ from sqlalchemy.exc import InterfaceError, OperationalError, ProgrammingError
|
|
|
14
14
|
|
|
15
15
|
from shared_kernel.dataclasses.warehouse_configs import FabricSQLConfig
|
|
16
16
|
from shared_kernel.exceptions.http_exceptions import BadRequest
|
|
17
|
-
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
17
|
+
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection, cancel_check_connection
|
|
18
18
|
from shared_kernel.data_warehouse_handlers.utils import extract_sql_server_error_message
|
|
19
19
|
from shared_kernel.logger import Logger
|
|
20
20
|
from shared_kernel.config import Config
|
|
@@ -85,12 +85,13 @@ class FabricSQLWarehouseConnection(DataWarehouseConnection):
|
|
|
85
85
|
from sqlalchemy import event
|
|
86
86
|
|
|
87
87
|
connection_string = self._get_fabric_connection_params(cfg)
|
|
88
|
+
pool_size = int(Config.get("FABRIC_SQL_POOL_SIZE", 15))
|
|
88
89
|
|
|
89
90
|
engine = create_engine(
|
|
90
91
|
connection_string,
|
|
91
|
-
pool_size=
|
|
92
|
+
pool_size=pool_size,
|
|
92
93
|
max_overflow=5,
|
|
93
|
-
pool_timeout=
|
|
94
|
+
pool_timeout=300,
|
|
94
95
|
pool_recycle=1800,
|
|
95
96
|
pool_pre_ping=True,
|
|
96
97
|
)
|
|
@@ -188,6 +189,7 @@ class FabricSQLWarehouseConnection(DataWarehouseConnection):
|
|
|
188
189
|
return self._engines[key]
|
|
189
190
|
|
|
190
191
|
@contextmanager
|
|
192
|
+
@cancel_check_connection
|
|
191
193
|
def get_connection(self, retries: int = 3, delay: int = 5, query_timeout: int = 30):
|
|
192
194
|
"""Context manager for database connections with retry mechanism"""
|
|
193
195
|
engine = self._get_engine()
|
|
@@ -9,7 +9,7 @@ from typing import Dict, Any, Optional
|
|
|
9
9
|
|
|
10
10
|
from shared_kernel.dataclasses.warehouse_configs import JDBCConfig
|
|
11
11
|
from shared_kernel.exceptions.http_exceptions import BadRequest
|
|
12
|
-
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
12
|
+
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection, cancel_check_connection
|
|
13
13
|
from shared_kernel.logger import Logger
|
|
14
14
|
from shared_kernel.config import Config
|
|
15
15
|
from shared_kernel.data_warehouse_handlers.jdbc_driver_registry import get_jdbc_driver_config
|
|
@@ -112,6 +112,7 @@ class JDBCWarehouseConnection(DataWarehouseConnection):
|
|
|
112
112
|
# We don't raise yet, as the class might somehow be in the global classpath
|
|
113
113
|
|
|
114
114
|
@contextmanager
|
|
115
|
+
@cancel_check_connection
|
|
115
116
|
def get_connection(self, retries: int = 3, delay: int = 5, query_timeout: int = 30):
|
|
116
117
|
"""Context manager for JDBC database connections with retry mechanism."""
|
|
117
118
|
last_exception = None
|
|
@@ -12,7 +12,7 @@ from sqlalchemy.exc import InterfaceError, OperationalError, ProgrammingError
|
|
|
12
12
|
|
|
13
13
|
from shared_kernel.dataclasses.warehouse_configs import MSSQLConfig
|
|
14
14
|
from shared_kernel.exceptions.http_exceptions import BadRequest
|
|
15
|
-
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
15
|
+
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection, cancel_check_connection
|
|
16
16
|
from shared_kernel.constants.constants import get_constant
|
|
17
17
|
from shared_kernel.data_warehouse_handlers.utils import extract_sql_server_error_message
|
|
18
18
|
from shared_kernel.logger import Logger
|
|
@@ -62,10 +62,12 @@ class MSSQLWarehouseConnection(DataWarehouseConnection):
|
|
|
62
62
|
)
|
|
63
63
|
connect_args = {}
|
|
64
64
|
|
|
65
|
+
pool_size = int(Config.get("MSSQL_POOL_SIZE", 10))
|
|
66
|
+
|
|
65
67
|
self._engines[key] = create_engine(
|
|
66
68
|
connection_string,
|
|
67
69
|
connect_args=connect_args,
|
|
68
|
-
pool_size=
|
|
70
|
+
pool_size=pool_size,
|
|
69
71
|
max_overflow=5,
|
|
70
72
|
pool_timeout=30,
|
|
71
73
|
pool_recycle=1800,
|
|
@@ -78,6 +80,7 @@ class MSSQLWarehouseConnection(DataWarehouseConnection):
|
|
|
78
80
|
return self._engines[key]
|
|
79
81
|
|
|
80
82
|
@contextmanager
|
|
83
|
+
@cancel_check_connection
|
|
81
84
|
def get_connection(self, retries: int = 3, delay: int = 5, query_timeout: int = 30):
|
|
82
85
|
"""Context manager for database connections with retry mechanism"""
|
|
83
86
|
engine = self._get_engine()
|
|
@@ -14,7 +14,7 @@ from sqlalchemy.exc import InterfaceError, OperationalError, ProgrammingError
|
|
|
14
14
|
from shared_kernel.constants.constants import get_constant
|
|
15
15
|
from shared_kernel.dataclasses.warehouse_configs import MySQLConfig
|
|
16
16
|
from shared_kernel.exceptions.http_exceptions import BadRequest
|
|
17
|
-
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
17
|
+
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection, cancel_check_connection
|
|
18
18
|
from shared_kernel.logger import Logger
|
|
19
19
|
from shared_kernel.config import Config
|
|
20
20
|
|
|
@@ -68,10 +68,11 @@ class MySQLWarehouseConnection(DataWarehouseConnection):
|
|
|
68
68
|
connection_string = get_constant("mysql", "CONNECTION_STRING").format(
|
|
69
69
|
cfg.username, password, cfg.host, int(cfg.port), cfg.database
|
|
70
70
|
)
|
|
71
|
+
pool_size = int(Config.get("MYSQL_POOL_SIZE", 10))
|
|
71
72
|
self._engines[key] = create_engine(
|
|
72
73
|
connection_string,
|
|
73
74
|
connect_args=self._CONNECT_ARGS,
|
|
74
|
-
pool_size=
|
|
75
|
+
pool_size=pool_size,
|
|
75
76
|
max_overflow=5,
|
|
76
77
|
pool_timeout=30,
|
|
77
78
|
pool_recycle=1800,
|
|
@@ -82,6 +83,7 @@ class MySQLWarehouseConnection(DataWarehouseConnection):
|
|
|
82
83
|
return self._engines[key]
|
|
83
84
|
|
|
84
85
|
@contextmanager
|
|
86
|
+
@cancel_check_connection
|
|
85
87
|
def get_connection(self, retries: int = 3, delay: int = 5, query_timeout: int = 30):
|
|
86
88
|
engine = self._get_engine()
|
|
87
89
|
last_exception = None
|
|
@@ -12,7 +12,7 @@ from sqlalchemy.exc import InterfaceError, OperationalError, ProgrammingError, S
|
|
|
12
12
|
|
|
13
13
|
from shared_kernel.dataclasses.warehouse_configs import PostgreSQLConfig
|
|
14
14
|
from shared_kernel.exceptions.http_exceptions import BadRequest
|
|
15
|
-
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
15
|
+
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection, cancel_check_connection
|
|
16
16
|
from shared_kernel.logger import Logger
|
|
17
17
|
from shared_kernel.config import Config
|
|
18
18
|
|
|
@@ -61,9 +61,10 @@ class PostgreSQLWarehouseConnection(DataWarehouseConnection):
|
|
|
61
61
|
f"postgresql+psycopg2://{cfg.username}:{password}"
|
|
62
62
|
f"@{cfg.host}:{cfg.port}/{cfg.database}"
|
|
63
63
|
)
|
|
64
|
+
pool_size = int(Config.get("POSTGRES_POOL_SIZE", 10))
|
|
64
65
|
self._engines[key] = create_engine(
|
|
65
66
|
url,
|
|
66
|
-
pool_size=
|
|
67
|
+
pool_size=pool_size,
|
|
67
68
|
max_overflow=5,
|
|
68
69
|
pool_timeout=30,
|
|
69
70
|
pool_recycle=1800,
|
|
@@ -75,6 +76,7 @@ class PostgreSQLWarehouseConnection(DataWarehouseConnection):
|
|
|
75
76
|
return self._engines[key]
|
|
76
77
|
|
|
77
78
|
@contextmanager
|
|
79
|
+
@cancel_check_connection
|
|
78
80
|
def get_connection(self, retries: int = 3, delay: int = 5, query_timeout: int = 30):
|
|
79
81
|
"""Context manager for database connections with retry mechanism"""
|
|
80
82
|
engine = self._get_engine()
|
|
@@ -12,7 +12,7 @@ from sqlalchemy.exc import InterfaceError, OperationalError, ProgrammingError
|
|
|
12
12
|
|
|
13
13
|
from shared_kernel.dataclasses.warehouse_configs import RedshiftConfig
|
|
14
14
|
from shared_kernel.exceptions.http_exceptions import BadRequest
|
|
15
|
-
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
15
|
+
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection, cancel_check_connection
|
|
16
16
|
from shared_kernel.logger import Logger
|
|
17
17
|
from shared_kernel.config import Config
|
|
18
18
|
|
|
@@ -194,9 +194,10 @@ class RedshiftWarehouseConnection(DataWarehouseConnection):
|
|
|
194
194
|
f"redshift+redshift_connector://{cfg.username}:{cfg.password}"
|
|
195
195
|
f"@{cfg.host}:{cfg.port}/{cfg.database}"
|
|
196
196
|
)
|
|
197
|
+
pool_size = int(Config.get("REDSHIFT_POOL_SIZE", 10))
|
|
197
198
|
self._engines[key] = create_engine(
|
|
198
199
|
url,
|
|
199
|
-
pool_size=
|
|
200
|
+
pool_size=pool_size,
|
|
200
201
|
max_overflow=5,
|
|
201
202
|
pool_timeout=30,
|
|
202
203
|
pool_recycle=1800,
|
|
@@ -222,6 +223,7 @@ class RedshiftWarehouseConnection(DataWarehouseConnection):
|
|
|
222
223
|
return False
|
|
223
224
|
|
|
224
225
|
@contextmanager
|
|
226
|
+
@cancel_check_connection
|
|
225
227
|
def get_connection(self, retries: int = 3, delay: int = 5, query_timeout: int = 30):
|
|
226
228
|
"""Context manager for database connections with retry mechanism"""
|
|
227
229
|
engine = self._get_engine()
|
|
@@ -19,7 +19,7 @@ from snowflake.connector.errors import (
|
|
|
19
19
|
from shared_kernel.data_warehouse_handlers.utils import extract_snowflake_error_message
|
|
20
20
|
from shared_kernel.dataclasses.warehouse_configs import SnowflakeConfig
|
|
21
21
|
from shared_kernel.exceptions.http_exceptions import BadRequest
|
|
22
|
-
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
22
|
+
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection, cancel_check_connection
|
|
23
23
|
from shared_kernel.logger import Logger
|
|
24
24
|
from shared_kernel.config import Config
|
|
25
25
|
|
|
@@ -111,6 +111,7 @@ class SnowflakeWarehouseConnection(DataWarehouseConnection):
|
|
|
111
111
|
self.close_connection()
|
|
112
112
|
|
|
113
113
|
@contextmanager
|
|
114
|
+
@cancel_check_connection
|
|
114
115
|
def get_connection(self, retries: int = 3, delay: int = 5, query_timeout: int = 30):
|
|
115
116
|
if not (self._conn and self.is_valid_connection()):
|
|
116
117
|
self._create_connection_with_retry(retries, delay)
|
|
@@ -6,7 +6,7 @@ from typing import Any, Dict, List, Optional, Tuple
|
|
|
6
6
|
from databricks.sql.exc import InterfaceError, OperationalError, ProgrammingError
|
|
7
7
|
|
|
8
8
|
from shared_kernel.config import Config
|
|
9
|
-
from shared_kernel.
|
|
9
|
+
from shared_kernel.data_warehouse_handlers.base_executor import BaseQueryExecutor, cancel_check
|
|
10
10
|
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
11
11
|
from shared_kernel.logger import Logger
|
|
12
12
|
|
|
@@ -15,11 +15,12 @@ logger = Logger(config.get("APP_NAME"))
|
|
|
15
15
|
MAX_QUERY_CONCURRENCY = 5
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
class DatabricksQueryExecutor(
|
|
18
|
+
class DatabricksQueryExecutor(BaseQueryExecutor):
|
|
19
19
|
|
|
20
20
|
def __init__(self, warehouse_connection: DataWarehouseConnection) -> None:
|
|
21
21
|
self.warehouse_connection = warehouse_connection
|
|
22
22
|
|
|
23
|
+
@cancel_check
|
|
23
24
|
def execute_query(
|
|
24
25
|
self,
|
|
25
26
|
query: str,
|
|
@@ -29,6 +30,7 @@ class DatabricksQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
29
30
|
Execute a single SQL query and return all rows as a list of dicts.
|
|
30
31
|
"""
|
|
31
32
|
with self.warehouse_connection.get_connection() as cursor:
|
|
33
|
+
self.active_connections.add(cursor)
|
|
32
34
|
try:
|
|
33
35
|
logger.info(f"Executing query: {query}")
|
|
34
36
|
start = time.perf_counter()
|
|
@@ -49,6 +51,8 @@ class DatabricksQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
49
51
|
raise Exception(f"Query execution failed: {str(e)}") from e
|
|
50
52
|
except Exception as e:
|
|
51
53
|
raise Exception(f"Query execution failed: {str(e)}") from e
|
|
54
|
+
finally:
|
|
55
|
+
self.active_connections.discard(cursor)
|
|
52
56
|
|
|
53
57
|
def execute_queries(
|
|
54
58
|
self,
|
|
@@ -84,12 +88,14 @@ class DatabricksQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
84
88
|
|
|
85
89
|
return results
|
|
86
90
|
|
|
91
|
+
@cancel_check
|
|
87
92
|
def execute_query_with_column_types(
|
|
88
93
|
self,
|
|
89
94
|
query: str,
|
|
90
95
|
params: Optional[tuple] = None,
|
|
91
96
|
) -> Tuple[List[Dict[str, Any]], List[Tuple]]:
|
|
92
97
|
with self.warehouse_connection.get_connection() as cursor:
|
|
98
|
+
self.active_connections.add(cursor)
|
|
93
99
|
try:
|
|
94
100
|
logger.info(f"Executing query with column types: {query}")
|
|
95
101
|
start = time.perf_counter()
|
|
@@ -115,4 +121,14 @@ class DatabricksQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
115
121
|
raise Exception(f"Query execution failed: {str(e)}") from e
|
|
116
122
|
except Exception as e:
|
|
117
123
|
raise Exception(f"Query execution failed: {str(e)}") from e
|
|
124
|
+
finally:
|
|
125
|
+
self.active_connections.discard(cursor)
|
|
126
|
+
|
|
127
|
+
def cancel(self) -> None:
|
|
128
|
+
"""
|
|
129
|
+
Cancels all active Databricks query cursors.
|
|
130
|
+
"""
|
|
131
|
+
logger.warning(f"Cancelling {len(self.active_connections)} active Databricks query cursor(s).")
|
|
132
|
+
for cursor in list(self.active_connections):
|
|
133
|
+
self._cancel_connection(cursor)
|
|
118
134
|
|
|
@@ -8,7 +8,7 @@ from sqlalchemy.exc import InterfaceError, OperationalError, ProgrammingError
|
|
|
8
8
|
|
|
9
9
|
from shared_kernel.config import Config
|
|
10
10
|
from shared_kernel.data_warehouse_handlers.utils import extract_error_message
|
|
11
|
-
from shared_kernel.
|
|
11
|
+
from shared_kernel.data_warehouse_handlers.base_executor import BaseQueryExecutor, cancel_check
|
|
12
12
|
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
13
13
|
from shared_kernel.logger import Logger
|
|
14
14
|
|
|
@@ -17,7 +17,7 @@ logger = Logger(config.get("APP_NAME"))
|
|
|
17
17
|
MAX_QUERY_CONCURRENCY = 5
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class FabricSQLQueryExecutor(
|
|
20
|
+
class FabricSQLQueryExecutor(BaseQueryExecutor):
|
|
21
21
|
"""
|
|
22
22
|
Query executor for Microsoft Fabric SQL Server
|
|
23
23
|
"""
|
|
@@ -25,6 +25,7 @@ class FabricSQLQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
25
25
|
def __init__(self, warehouse_connection: DataWarehouseConnection) -> None:
|
|
26
26
|
self.warehouse_connection = warehouse_connection
|
|
27
27
|
|
|
28
|
+
@cancel_check
|
|
28
29
|
def execute_query(
|
|
29
30
|
self,
|
|
30
31
|
query: str,
|
|
@@ -34,15 +35,12 @@ class FabricSQLQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
34
35
|
Execute a single SQL query and return all rows as a list of dicts.
|
|
35
36
|
"""
|
|
36
37
|
with self.warehouse_connection.get_connection() as conn:
|
|
38
|
+
self.active_connections.add(conn)
|
|
37
39
|
try:
|
|
38
40
|
logger.info(f"Executing query: {query}")
|
|
39
41
|
start = time.perf_counter()
|
|
40
42
|
|
|
41
|
-
result = (
|
|
42
|
-
conn.execute(text(query), params)
|
|
43
|
-
if params
|
|
44
|
-
else conn.execute(text(query))
|
|
45
|
-
)
|
|
43
|
+
result = conn.execute(text(query), params) if params else conn.execute(text(query))
|
|
46
44
|
|
|
47
45
|
elapsed = time.perf_counter() - start
|
|
48
46
|
logger.info(f"Query executed in {elapsed:.6f}s")
|
|
@@ -64,6 +62,8 @@ class FabricSQLQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
64
62
|
except Exception as e:
|
|
65
63
|
user_msg = extract_error_message(str(e))
|
|
66
64
|
raise Exception(f"Query execution failed: {user_msg}") from e
|
|
65
|
+
finally:
|
|
66
|
+
self.active_connections.discard(conn)
|
|
67
67
|
|
|
68
68
|
def execute_queries(
|
|
69
69
|
self,
|
|
@@ -99,6 +99,7 @@ class FabricSQLQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
99
99
|
|
|
100
100
|
return results
|
|
101
101
|
|
|
102
|
+
@cancel_check
|
|
102
103
|
def execute_query_with_column_types(
|
|
103
104
|
self,
|
|
104
105
|
query: str,
|
|
@@ -108,15 +109,12 @@ class FabricSQLQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
108
109
|
Execute a query and return both rows and raw DBAPI cursor description.
|
|
109
110
|
"""
|
|
110
111
|
with self.warehouse_connection.get_connection() as conn:
|
|
112
|
+
self.active_connections.add(conn)
|
|
111
113
|
try:
|
|
112
114
|
logger.info(f"Executing query with column types: {query}")
|
|
113
115
|
start = time.perf_counter()
|
|
114
116
|
|
|
115
|
-
result = (
|
|
116
|
-
conn.execute(text(query), params)
|
|
117
|
-
if params
|
|
118
|
-
else conn.execute(text(query))
|
|
119
|
-
)
|
|
117
|
+
result = conn.execute(text(query), params) if params else conn.execute(text(query))
|
|
120
118
|
|
|
121
119
|
elapsed = time.perf_counter() - start
|
|
122
120
|
logger.info(f"Query executed in {elapsed:.6f}s")
|
|
@@ -140,3 +138,13 @@ class FabricSQLQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
140
138
|
except Exception as e:
|
|
141
139
|
user_msg = extract_error_message(str(e))
|
|
142
140
|
raise Exception(f"Query execution failed: {user_msg}") from e
|
|
141
|
+
finally:
|
|
142
|
+
self.active_connections.discard(conn)
|
|
143
|
+
|
|
144
|
+
def cancel(self) -> None:
|
|
145
|
+
"""
|
|
146
|
+
Cancels all active Fabric SQL query connections.
|
|
147
|
+
"""
|
|
148
|
+
logger.warning(f"Cancelling {len(self.active_connections)} active Fabric SQL query connection(s).")
|
|
149
|
+
for conn in list(self.active_connections):
|
|
150
|
+
self._cancel_connection(conn)
|
|
@@ -3,7 +3,7 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
|
3
3
|
from typing import Any, Dict, List, Optional, Tuple
|
|
4
4
|
|
|
5
5
|
from shared_kernel.config import Config
|
|
6
|
-
from shared_kernel.
|
|
6
|
+
from shared_kernel.data_warehouse_handlers.base_executor import BaseQueryExecutor, cancel_check
|
|
7
7
|
from shared_kernel.interfaces.warehouse_connection import DataWarehouseConnection
|
|
8
8
|
from shared_kernel.logger import Logger
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ config = Config()
|
|
|
11
11
|
logger = Logger(config.get("APP_NAME"))
|
|
12
12
|
MAX_QUERY_CONCURRENCY = 5
|
|
13
13
|
|
|
14
|
-
class JDBCQueryExecutor(
|
|
14
|
+
class JDBCQueryExecutor(BaseQueryExecutor):
|
|
15
15
|
"""
|
|
16
16
|
Query executor for JDBC connections.
|
|
17
17
|
"""
|
|
@@ -19,6 +19,7 @@ class JDBCQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
19
19
|
def __init__(self, warehouse_connection: DataWarehouseConnection) -> None:
|
|
20
20
|
self.warehouse_connection = warehouse_connection
|
|
21
21
|
|
|
22
|
+
@cancel_check
|
|
22
23
|
def execute_query(
|
|
23
24
|
self,
|
|
24
25
|
query: str,
|
|
@@ -28,6 +29,7 @@ class JDBCQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
28
29
|
Execute a single SQL query and return all rows as a list of dicts.
|
|
29
30
|
"""
|
|
30
31
|
with self.warehouse_connection.get_connection() as conn:
|
|
32
|
+
self.active_connections.add(conn)
|
|
31
33
|
cursor = conn.cursor()
|
|
32
34
|
try:
|
|
33
35
|
logger.info(f"Executing JDBC query: {query}")
|
|
@@ -56,6 +58,7 @@ class JDBCQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
56
58
|
raise Exception(f"JDBC Query execution failed: {str(e)}") from e
|
|
57
59
|
finally:
|
|
58
60
|
cursor.close()
|
|
61
|
+
self.active_connections.discard(conn)
|
|
59
62
|
|
|
60
63
|
def execute_queries(
|
|
61
64
|
self,
|
|
@@ -87,6 +90,7 @@ class JDBCQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
87
90
|
|
|
88
91
|
return results
|
|
89
92
|
|
|
93
|
+
@cancel_check
|
|
90
94
|
def execute_query_with_column_types(
|
|
91
95
|
self,
|
|
92
96
|
query: str,
|
|
@@ -96,6 +100,7 @@ class JDBCQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
96
100
|
Execute a query and return both rows and raw cursor description.
|
|
97
101
|
"""
|
|
98
102
|
with self.warehouse_connection.get_connection() as conn:
|
|
103
|
+
self.active_connections.add(conn)
|
|
99
104
|
cursor = conn.cursor()
|
|
100
105
|
try:
|
|
101
106
|
logger.info(f"Executing JDBC query with column types: {query}")
|
|
@@ -125,3 +130,16 @@ class JDBCQueryExecutor(DataWarehouseQueryExecutor):
|
|
|
125
130
|
raise Exception(f"JDBC Query execution failed: {str(e)}") from e
|
|
126
131
|
finally:
|
|
127
132
|
cursor.close()
|
|
133
|
+
self.active_connections.discard(conn)
|
|
134
|
+
|
|
135
|
+
def cancel(self) -> None:
|
|
136
|
+
"""
|
|
137
|
+
Cancels all active JDBC query connections by closing them directly.
|
|
138
|
+
"""
|
|
139
|
+
logger.warning(f"Cancelling {len(self.active_connections)} active JDBC connection(s).")
|
|
140
|
+
for conn in list(self.active_connections):
|
|
141
|
+
try:
|
|
142
|
+
logger.info("Closing active JDBC connection to abort running query.")
|
|
143
|
+
conn.close()
|
|
144
|
+
except Exception as e:
|
|
145
|
+
logger.error(f"Error closing JDBC connection during cancel: {e}")
|