acoustic-carpenter-78188
02/01/2023, 1:27 AMdict or typing.Dict annotation. This will break code that relies on precise types, such as sklearn, which explicitly checks the types of hyperparameter values in Estimator constructor.
Type
☑︎ Bug Fix
☐ Feature
☐ Plugin
Are all requirements met?
☑︎ Code completed
☑︎ Smoke tested
☑︎ Unit tests added
☐ Code documentation added
☐ Any pending items have an associated Issue
Complete description
Because the interchange between protobuf and json casts ints to floats, this PR introduces a workaround to handle converting floats to integers by parsing the protobug struct_pb2.Value with regex and inferring integers based on its __repr__, which actually preserves the integer representation, e.g. number_value: 100, but accessing the actual number_value attribute will still return a float assert value.number_value == 100.0.
See here in the protobuf codebase where ints and floats are treated the same.
Tracking Issue
flyteorg/flyte#3158
Follow-up issue
NA
flyteorg/flytekit
GitHub Actions: lint
GitHub Actions: docs
GitHub Actions: build-plugins (3.10, flytekit-vaex)
GitHub Actions: build-plugins (3.9, flytekit-whylogs)
GitHub Actions: build-plugins (3.9, flytekit-vaex)
GitHub Actions: build-plugins (3.9, flytekit-sqlalchemy)
GitHub Actions: build-plugins (3.9, flytekit-spark)
GitHub Actions: build-plugins (3.9, flytekit-snowflake)
GitHub Actions: build-plugins (3.9, flytekit-ray)
✅ 21 other checks have passed
21/30 successful checksacoustic-carpenter-78188
02/01/2023, 4:03 PMacoustic-carpenter-78188
02/01/2023, 7:28 PM