<#3158 [BUG] dict type converts int values to floa...
# flyte-github
c
#3158 [BUG] dict type converts int values to float Issue created by cosmicBboy ### Describe the bug This is an issue in unionml, where hyperparameters fall back to using
dict
or
typing.Dict
automatically converts ints to floats: from flytekit import task, workflow from typing import Dict @task def t1(x: Dict) -> Dict: return x @workflow def wf() -> Dict: return t1(x={"a": 100}) if name == "__main__": print(wf()) # output: {'a': 100.0} This is a problem because some frameworks like sklearn will do hyperparameter argument validation:
Copy code
InvalidParameterError: The 'max_iter' parameter of LogisticRegression must be an int in the range [0, inf). Got 1000.0 instead.
### Expected behavior The types inside
dict
should be preserved ### Additional context to reproduce No response ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte