You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ossie.apache.org by "Ashfaqbs (via GitHub)" <gi...@apache.org> on 2026/10/04 14:37:03 UTC
[PR] fix(salesforce): restore metric custom_extensions, default label, respect restored dataType [ossie]
Ashfaqbs opened a new pull request, #512:
URL: https://github.com/apache/ossie/pull/512
Implemented with Claude Code (model: Claude Sonnet 5, autonomous mode); comment/commit fully AI-drafted.
Supersedes #402, which was based on `MetricMappingHandler` before #404 rewrote `unwrapExpressions()` into a full JSqlParser-backed Tua expression compiler. Rebasing #402 directly produced conflicts in the same file, and most of its TABLEAU-only enforcement logic is now obsolete (the new compiler already supports TABLEAU/SNOWFLAKE/ANSI_SQL dialects properly). This PR re-derives just the part of #402 that is still a real, unaddressed gap on current `main`, carrying forward @jbonofre's review feedback from #402:
- `mapOssieToSalesforce()` is the only one of the four array-level handlers (datasets, relationships, semantic model, metrics) that never called `CustomExtensionHandler.restoreCustomExtensionsAtLevel()` for its own level, even though `Level.METRICS` has existed in that switch since the mechanism was added. A metric's `custom_extensions` were silently dropped on Ossie -> Salesforce export.
- Ossie metrics have no `label` field, so every exported `semanticCalculatedMeasurement` had none unless `custom_extensions` restored one. Defaulted it to `apiName`, matching `DatasetMappingHandler`/`SemanticModelMappingHandler`.
- The Tua compiler's `dataType` assignment now uses `putIfAbsent`, so an exact Salesforce `dataType` restored from `custom_extensions` (e.g. `Currency`) isn't clobbered by the derived type.
Restore runs before `unwrapExpressions()`, since `restoreSalesforceCustomExtension` only fills keys that are still absent.
Added `testMetricCustomExtensionsRestoredBeforeExpressionCompilation` covering: a metric with `custom_extensions` (label + dataType) gets both restored without disturbing its compiled Tua expression/syntax, while a metric without `custom_extensions` still gets its label defaulted to `apiName` and keeps its derived `dataType`.
## Test plan
- `mvn test` in `converters/salesforce`: 285 tests, 0 failures, 0 errors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(salesforce): restore metric custom_extensions, default label, respect restored dataType [ossie]
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre merged PR #512:
URL: https://github.com/apache/ossie/pull/512
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org