Skip to content

feat: add Time, Variant, and Binary primitive types (Issue #220)#311

Open
buddywhitman wants to merge 1 commit into
finos:mainfrom
buddywhitman:feature/add-time-variant-binary-types-220
Open

feat: add Time, Variant, and Binary primitive types (Issue #220)#311
buddywhitman wants to merge 1 commit into
finos:mainfrom
buddywhitman:feature/add-time-variant-binary-types-220

Conversation

@buddywhitman

Copy link
Copy Markdown

Closes #220

What this does

Adds the three missing primitive types requested in Issue #220 through the full type chain.

Changes by layer

Layer Change
PrimitiveType enum Time=24, Variant=25, Binary=26
PrimitiveTdsColumn .time_column(), .variant_column(), .binary_column() factory methods
Expression return type PyLegendExpressionTimeReturn ABC
Column expressions PyLegendTimeColumnExpression, PyLegendVariantColumnExpression, PyLegendBinaryColumnExpression
Language primitives PyLegendTime (standalone); PyLegendVariant/PyLegendBinary extend PyLegendString
Cast functions type_factory.time(), type_factory.variant(), type_factory.binary()

tds_columns_from_json correctly round-trips all three new types (type name resolved by string).

Variant/Binary as String: intentional — both serialize to strings in standard query
engines (JSON for Variant, hex for Binary). Time-arithmetic functions can follow.

Tests

pytest tests/core/language/shared/primitives/test_new_types.py -v  # 20 passed
# Existing tds_column tests: 9/9 unaffected
# flake8 --max-line-length=127: clean
# mypy --strict: clean

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 11, 2026

Copy link
Copy Markdown

CLA Not Signed

Implements the three missing primitive types requested in Issue finos#220
through the full 6-layer type chain:

- PrimitiveType enum: Time=24, Variant=25, Binary=26
- PrimitiveTdsColumn: .time_column(), .variant_column(), .binary_column()
- PyLegendExpressionTimeReturn ABC for type-safe Time expressions
- Column expressions for TDS frame column access
- PyLegendTime (standalone primitive), PyLegendVariant/Binary (String subclasses)
- type_factory.time(), .variant(), .binary() cast-target functions

tds_columns_from_json correctly round-trips all three new types.
Passes flake8 (max-line-length=127) and mypy --strict.
@buddywhitman buddywhitman force-pushed the feature/add-time-variant-binary-types-220 branch from 9df688f to 8a91500 Compare June 11, 2026 02:38
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.

Add missing types to PyLegend

2 participants