feat: add Time, Variant, and Binary primitive types (Issue #220)#311
Open
buddywhitman wants to merge 1 commit into
Open
feat: add Time, Variant, and Binary primitive types (Issue #220)#311buddywhitman wants to merge 1 commit into
buddywhitman wants to merge 1 commit into
Conversation
|
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.
9df688f to
8a91500
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #220
What this does
Adds the three missing primitive types requested in Issue #220 through the full type chain.
Changes by layer
PrimitiveTypeenumTime=24,Variant=25,Binary=26PrimitiveTdsColumn.time_column(),.variant_column(),.binary_column()factory methodsPyLegendExpressionTimeReturnABCPyLegendTimeColumnExpression,PyLegendVariantColumnExpression,PyLegendBinaryColumnExpressionPyLegendTime(standalone);PyLegendVariant/PyLegendBinaryextendPyLegendStringtype_factory.time(),type_factory.variant(),type_factory.binary()tds_columns_from_jsoncorrectly 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