Salesforce converter: translate OSI metric expressions and validate field references

Open
#403 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python, sql
Domain
data

Research direction

Start with the metric export work in #402 and the expression-language work in #222, then map the stated SQL expression scope to Tableau syntax and reference validation. Add unit and schema coverage for combinations, nulls, duplicates, empty inputs and zero denominators; done means clear metric-named errors for unsupported expressions, missing fields and ambiguous references, with results validated in Tableau Next.

Written by the indexing model from the issue text.

Description

#402 adds metric export but leaves expression translation and field-reference validation for follow-up work. This issue covers that work, including the reference validation requested in #399.

The goal is to convert supported SQL expressions into Tableau formulas so users can reuse their OSI metric definitions without maintaining a separate Tableau expression for each metric.

Initial scope

  • Aggregates: SUM, AVG, MIN, MAX, COUNT(field) and COUNT(DISTINCT field).
  • Arithmetic: +, -, *, /, parentheses and numeric constants.
  • Conditional logic: CASE WHEN, comparisons, AND, OR and NOT.
  • Null handling: COALESCE, NULLIF, IS NULL and IS NOT NULL.
  • Numeric functions: ABS, ROUND, CEIL and FLOOR.

Support combinations of these functions, including expressions such as:

SUM(orders.amount * (1 - orders.discount))

SUM(CASE WHEN orders.status = 'paid'
         THEN orders.amount ELSE 0 END)

SUM(orders.profit) / NULLIF(SUM(orders.revenue), 0)

Expected behavior

  • Translate supported SNOWFLAKE and ANSI_SQL expressions into Tableau syntax.
  • Resolve references against declared datasets and fields, including quoted identifiers.
  • Validate types and aggregation rules while preserving the original calculation’s meaning.
  • Fail with the metric name and a clear explanation for unsupported expressions, missing fields or ambiguous references.
  • Test combinations, nulls, empty inputs, duplicates and zero denominators. Validate results in Tableau Next alongside unit and schema tests.

Date/time functions, string functions, casts, references to other metrics, window calculations and level-of-detail calculations can follow as separate milestones. COUNT(*) also needs separate handling to establish which dataset’s rows are being counted.

Source-object discovery, missing-field enrichment and deployment are outside this issue. The extension-preservation fixes identified in #402 should remain there.

i’ll take this on through follow-up PRs built on #402. The implementation should align with the expression-language work in #222.

Dominant language
Python
Stars
2.2k
Forks
280
Avg merge
2d 7h
Merged PRs (30d)
32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/ossie

All issues in apache/ossie

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.