Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix feature.shape attribute in from_merlin_schema #169

Merged
merged 2 commits into from
Nov 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions merlin/schema/io/tensorflow_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
import numpy

from merlin.schema.io import proto_utils, schema_bp
from merlin.schema.io.schema_bp import Feature, FeatureType, FixedShape, FloatDomain, IntDomain
from merlin.schema.io.schema_bp import (
Feature,
FeatureType,
FixedShape,
FixedShapeDim,
FloatDomain,
IntDomain,
)
from merlin.schema.io.schema_bp import Schema as ProtoSchema
from merlin.schema.io.schema_bp import ValueCount
from merlin.schema.schema import ColumnSchema
Expand Down Expand Up @@ -281,7 +288,7 @@ def _pb_feature(column_schema):
max_length = value_count.get("max")

if min_length and max_length and min_length == max_length:
feature.shape = FixedShape(min_length)
feature.shape = FixedShape([FixedShapeDim(size=min_length)])
elif min_length and max_length and min_length < max_length:
feature.value_count = ValueCount(min=min_length, max=max_length)
else:
Expand Down