Skip to content

Conversation

@MrBlack1995
Copy link
Contributor

Summary

Backend changes for KPI parsers and measure conversion infrastructure.

Changes

  • Backend changes for KPI parsers
  • Measure conversion infrastructure
  • YAML to DAX migration and converters package reorganization

Related Commits

  • 3a7d2b3 Backend changes KPI parsers
  • 1360236 Migrate yaml2dax and reorganize converters package structure
  • 6a5ca0b Add measure conversion infrastructure

🤖 Generated with Claude Code

MrBlack1995 and others added 30 commits November 7, 2025 18:21
Front page/ README optical changes
Implement base architecture for converting business measures between formats (YAML, DAX, SQL, UC Metrics, Power BI).

- Create converters package with clean architecture pattern
  - Base classes: BaseConverter, ConverterFactory
  - Data models: KBI, DAXMeasure, SQLMeasure, UCMetric
  - Placeholder structure for formats, rules, and utilities

- Add API layer
  - REST endpoints: /api/measure-conversion/*
  - Routes: convert, validate, batch-convert, get formats
  - Register router in main API

- Add service layer
  - MeasureConversionService for business logic
  - Async operations with error handling
  - Factory pattern for converter instantiation

- Add Pydantic schemas
  - Request/response models
  - Validation schemas
  - OpenAPI documentation

- Add comprehensive README with usage examples

Prepared for integration of existing yaml2dax conversion logic.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Integrate all working yaml2dax conversion logic and reorganize into clean,
hierarchical package structure with improved naming conventions.

## Migration
- Migrate all yaml2dax components (parsers, generators, processors, translators)
- Create concrete converter implementations (YAML→DAX, YAML→SQL, YAML→UC Metrics)
- Auto-register all converters via registry module
- Update all imports to new package structure

## Reorganization
- Rename: measure/ → processors/ (clearer purpose)
- Split formats/ into parsers/ and generators/ subdirectories
- Split rules/ into aggregations/ and translators/ subdirectories
- Move converters to implementations/ subdirectory
- Rename converter files for consistency (remove _converter suffix)

## New Structure
converters/
├── base/               # Framework (BaseConverter, ConverterFactory)
├── models/             # Data models (KBI, SQL models)
├── formats/
│   ├── parsers/       # YAML, formula parsers
│   └── generators/    # DAX, SQL generators
├── processors/         # Structure, UC metrics processors
├── rules/
│   ├── aggregations/  # DAX, SQL aggregation rules
│   └── translators/   # Filter, formula, dependency resolvers
├── implementations/    # Concrete converters (yaml_to_dax, yaml_to_sql, yaml_to_uc_metrics)
└── registry.py        # Auto-registration

## Components Migrated (18 files)
- Parsers: yaml_parser, formula_parser
- Generators: dax_generator, sql_generator, smart_dax, tree_parsing_dax
- Processors: structure_processor, sql_structure_processor, uc_metrics_processor
- Rules: filter_resolver, formula_translator, dependency_resolver
- Aggregations: dax_aggregations, sql_aggregations
- Models: sql_models (SQLQuery, SQLDialect, etc.)
- Converters: 3 concrete implementations

## Benefits
- Clean hierarchical organization
- Logical grouping by purpose
- Consistent naming conventions
- Easy to extend and maintain
- Industry-standard package structure

All yaml2dax conversion logic now integrated and functional via API endpoints.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
  2. Imported it in TaskForm.tsx
  3. Changed the state type from Record<string, unknown> to MeasureConverterConfig
  4. Updated the type cast when loading from initialData
Resolved merge conflicts by integrating both feature sets:

Backend (crewai_execution_service.py):
- Merged 'prefer YAML' tool_configs logic from feature/flow
- Kept dynamic task description updates for Measure Conversion Pipeline
- Both features now work together harmoniously

Frontend (TaskForm.tsx):
- Integrated both MeasureConverterConfigSelector and PowerBIConfigSelector
- Added state variables and imports for both tools
- Config loading and saving handlers for both tools
- UI sections for both configuration selectors

Other resolved files:
- src/api/__init__.py: Merged routers (kpi_conversion, converter, agentbricks)
- src/engines/crewai/helpers/task_helpers.py: Merged logging for both tools
- src/engines/crewai/logging_config.py: Merged all logger configurations
- src/engines/crewai/tools/custom/__init__.py: Merged all tool exports
- src/seeds/tools.py: Renumbered tool IDs to avoid conflicts (71→73, 72→74, 73→75, 74→76)

All conflicts resolved without data loss.
- Fixed tool ID conflicts in default_config dict
- Fixed tool ID conflicts in enabled_tool_ids lists
- Tool 72: PowerBIAnalysisTool (from origin/feature/flow)
- Tool 73: YAMLToDAXTool (renumbered from 71)
- Tool 74: YAMLToSQLTool (renumbered from 72)
- Tool 75: YAMLToUCMetricsTool (renumbered from 73)
- Tool 76: Measure Conversion Pipeline (renumbered from 74)
- Updated enabled tools list: 6, 16, 26, 31, 35, 36, 67, 69, 70, 72, 76
- Tools 73-75 disabled in favor of unified pipeline (76)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants