Python Module Facades
Relevant source files
The following files were used as context for generating this wiki page:
- src/flext_dbt_oracle_wms/__init__.py
- src/flext_dbt_oracle_wms/_simple_api_base.py
- src/flext_dbt_oracle_wms/_simple_api_metadata.py
- src/flext_dbt_oracle_wms/_simple_api_workflow.py
- src/flext_dbt_oracle_wms/_utilities/client.py
- src/flext_dbt_oracle_wms/utilities.py
- src/flext_dbt_oracle_wms/protocols.py
The Python Module Facades in the flext-dbt-oracle-wms project provide a unified, high-level interface for orchestrating Oracle Warehouse Management System (WMS) data transformations using DBT. These facades abstract the complexities of underlying domain clients, Meltano runners, and service-level tracking to expose a simplified API for workflow execution, metadata extraction, and connection validation.
The architecture follows a layered inheritance pattern where base logic for configuration and client management is extended into specialized metadata and workflow orchestration layers. This ensures that developers can interact with the system through a single public surface (e.g., FlextDbtOracleWms) while maintaining clean separation between low-level extraction and high-level pipeline management.
Sources: src/flext_dbt_oracle_wms/_simple_api_base.py:12-20, src/flext_dbt_oracle_wms/_simple_api_workflow.py:15-20, README.md:13-18
Facade Architecture and Inheritance
The facade system is structured through a chain of classes that progressively add functionality. This hierarchy ensures that every facade has access to core settings, a specialized client for Oracle WMS interactions, and a service helper for instrumentation.
Class Hierarchy
The following diagram illustrates the relationship between the base facade and its specialized implementations:
Note: The hierarchy culminates in the FlextDbtOracleWmsWorkflow which is often exposed as the primary public entry point FlextDbtOracleWms.
Sources: src/flext_dbt_oracle_wms/_simple_api_base.py:12, src/flext_dbt_oracle_wms/_simple_api_metadata.py:15, src/flext_dbt_oracle_wms/_simple_api_workflow.py:15
Core Components
| Component | Description | Source |
|---|---|---|
| Settings | Managed via FlextDbtOracleWmsSettings, providing dbt threads, targets, and WMS base URLs. | src/flext_dbt_oracle_wms/_simple_api_base.py:44-53 |
| Client | FlextDbtOracleWmsClient handles the heavy lifting of Oracle WMS entity discovery and extraction. | src/flext_dbt_oracle_wms/_utilities/client.py:20-30 |
| Service | u.DbtOracleWms.Service provides tracking, logging, and workflow recommendations. | src/flext_dbt_oracle_wms/utilities.py:61-118 |
Workflow Orchestration
The FlextDbtOracleWmsWorkflow facade is responsible for executing the end-to-end "Oracle WMS to DBT" pipeline. This involves resolving entity names, tracking execution status, optionally generating models, and triggering data transformations.
Oracle WMS to DBT Pipeline Flow
The execution flow is highly configurable, allowing for metadata-only runs or full data transformation pipelines.
Workflow Methods
run_oracle_wms_to_dbt_workflow: The primary method that orchestrates the sequence of entity resolution, tracking, model generation, and transformation.validate_wms_connection: Uses the internal client to perform a health check against the Oracle WMS instance.
Sources: src/flext_dbt_oracle_wms/_simple_api_workflow.py:28-87, src/flext_dbt_oracle_wms/_simple_api_workflow.py:102-111
Client and Infrastructure Abstraction
The facades rely on FlextDbtOracleWmsClient to bridge the gap between high-level workflow requests and low-level data operations. This client integrates FlextMeltanoLibraryRunner for DBT execution and a specific FlextDbtOracleWmsTransformer for business rule validation.
Data Extraction and Validation Logic
When extracting data, the client performs mandatory field validation based on settings before passing data to the transformation layer.
Public Interface and Exports
The project uses lazy loading and an explicit public export list to ensure a clean API surface. The facade components are gathered in the package root for easy access.
Exported Facade Symbols
| Symbol | Purpose |
|---|---|
FlextDbtOracleWms | The primary unified facade (aliased from the workflow class). |
FlextDbtOracleWmsSettings | Configuration object for the facades. |
FlextDbtOracleWmsProtocols | Protocol definitions for integration points. |
u.DbtOracleWms.Service | Service helper for workflow lifecycle management. |
Sources: src/flext_dbt_oracle_wms/__init__.py:46-77, src/flext_dbt_oracle_wms/protocols.py:16-20
Summary
The Python Module Facades in flext-dbt-oracle-wms centralize the logic for Oracle WMS integration. By abstracting data extraction, validation, and DBT transformation into a structured hierarchy of facades, the system provides a robust and testable interface for complex enterprise data workflows.