Skip to content

fix(honeydew): honor a field's declared datatype in Ossie → Honeydew - #419

Draft
baruchoxman wants to merge 1 commit into
apache:mainfrom
honeydew-ai:fix-honeydew-datatype
Draft

baruchoxman wants to merge 1 commit into
apache:mainfrom
honeydew-ai:fix-honeydew-datatype

Conversation

@baruchoxman

@baruchoxman baruchoxman commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #411. _ossie_field_to_honeydew_datatype derived the Honeydew datatype only from the shape of dimension, so a Date field became number and a Boolean became string — the declared datatype had zero effect on the output. The heuristic dates back to the converter's first commit, when the spec had no datatype field; #113 added the enum and the converter was never updated.

What changed

  • converter.py: added _OSSIE_TO_HONEYDEW_DATATYPE, mapping the core-spec datatypes enum onto Honeydew's vocabulary. _ossie_field_to_honeydew_datatype now consults, in order: the round-tripped HONEYDEW extension datatype → the field's declared datatype → the existing dimension-shape heuristic. Opaque, absent, and unrecognized values fall through to the heuristic, so models that declare no datatype convert exactly as before.
  • README.md: replaced the now-false "Ossie fields have no explicit datatype" limitation with the actual mapping, and documented the two limitations that remain (see below).
  • Tests: all nine spec datatypes, the fallback cases (Opaque, unrecognized, non-string), extension-vs-declared precedence, an end-to-end file-content case, and a _fields_to_honeydew case covering both source and calculated attributes.

Mapping notes

Two deliberate deviations from the mapping suggested in the issue, both per Honeydew's attribute schema, where number means integer and float means floating point:

  • Floatfloat (not number) — number would claim it is integral.
  • Decimalfloat (not number) — Honeydew has no exact-decimal type, and Decimal is not integral either, so float is the closer approximation.

Per the spec, dimension.is_time is a role flag independent of type, so a year-grain field (datatype: Integer, is_time: true) now yields number rather than timestamp. That is the intended consequence of letting the declared type win.

Out of scope

Test plan

🤖 Generated with Claude Code

_ossie_field_to_honeydew_datatype derived the Honeydew datatype only from
the shape of `dimension`, so a `Date` field became `number` and a `Boolean`
became `string`. The heuristic dates back to the converter's first commit,
when the spec had no `datatype` field at all; apache#113 added the enum and the
converter was never updated.

Map the core-spec datatype enum onto Honeydew's vocabulary (bool, date,
float, number, string, time, timestamp) and consult it right after the
HONEYDEW round-trip extension. `Opaque`, absent and unrecognized values
keep falling back to the dimension-shape heuristic, so models that declare
no datatype convert exactly as before.

Honeydew's `number` is integral and `float` is approximate, so `Float` and
`Decimal` both map to `float`; `number` would claim they are integral.

Fixes apache#411

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@baruchoxman
baruchoxman marked this pull request as draft September 18, 2026 12:56
@jbonofre
jbonofre requested review from jbonofre and removed request for jbonofre September 19, 2026 11:37
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.

Ossie->Honeydew converter ignores a field's explicit datatype

1 participant