Skip to content

Salesforce converter drops OSI metrics during export #399

Description

@saurabhdeshp

i reproduced this on main at 1f367e35.

When exporting an OSI model to Salesforce using toSF, the converter generates objects and fields but skips the entire metrics[] section. It exits successfully without producing semanticCalculatedMeasurements.

This affects anyone relying on OSI metric definitions to create Salesforce semantic models, regardless of the source platform.

Example

A model declares a numeric orders.amount field and this metric:

metrics:
  - name: total_sales
    expression:
      dialects:
        - dialect: TABLEAU
          expression: SUM([orders].[amount])

The numeric field is exported, but total_sales is missing from the output. Using a TABLEAU expression does not resolve the issue.

The forward path in MetricMappingHandler explicitly skips metric mapping. The README documents this limitation, but successful conversion can still leave downstream automation with an incomplete model.

Proposed behavior

  • Export supported OSI metrics as semanticCalculatedMeasurements, preserving names, descriptions, expressions and types.
  • Resolve expressions against the model’s semantic fields.
  • Fail with an actionable error when a metric cannot be converted, rather than silently omitting it.
  • Add tests that verify metric preservation and resolved references, beyond JSON-schema validation.

Expression handling should align with the existing work in #222 and discussion #28.

Is anyone already working on this? i’d like to align on the scope before contributing an implementation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions