cuddly-jelly-27016
05/22/2025, 12:09 AMdict 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:
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/flytecuddly-jelly-27016
05/22/2025, 12:09 AM