We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It appears that when serializing/deserializing a dataclass, there is an issue where ints are cast to floats.
Dataclass
@dataclass_json @dataclass class Args(object): max_iter: int = 0 init_eval: int = 0 max_eval: int = 0 @dataclass_json @dataclass class Schema(object): name: str kwargs_list: List[str] = field(default_factory=list) kwargs: Optional[Args] = None extras: Optional[Dict[str, Any]] = None @dataclass_json @dataclass class ConfigSchema(object): description: str schema: Schema
Workflow file
@task def run_action(config: ConfigSchema, uuid: str) -> Schema: at = Action(config=config, uuid=uuid, persist=True) at.execute() return config.schema @dynamic def action_dynamic_workflow(config_file: str) -> typing.List[Schema]: uuid = str(uuid.uuid4()) config_file = os.path.join(project.get_project_root(), config_file) aconfigs = Configure.build_action_configs(config_file) ret : typing.List[Schema] = [] for aconfig in aconfigs: ret.append(run_action(config=aconfig, uuid=uuid)) return ret @workflow def action_workflow(config_file: str) -> typing.List[Schema]: return action_dynamic_workflow(config_file = config_file)
When running the task run_action, the int args are float and the code below is erroring, as an int is expected and defined in the dataclass
run_action
int
float
dataclass
All inputs to run_action will have the type that was specified in the dataclass definition, especially int vs float
Using flytekit v1.2.0b0 (There was a recent fix for a type conversion problem that seemed related, but the issue persists)
Could be related to #2775, but I tried using the new flytekit version without success
No response
The text was updated successfully, but these errors were encountered:
Thank you for opening your first issue here! 🛠
Sorry, something went wrong.
pingsutw
No branches or pull requests
Describe the bug
It appears that when serializing/deserializing a dataclass, there is an issue where ints are cast to floats.
Dataclass
Workflow file
When running the task
run_action
, theint
args arefloat
and the code below is erroring, as anint
is expected and defined in thedataclass
Expected behavior
All inputs to
run_action
will have the type that was specified in thedataclass
definition, especiallyint
vsfloat
Additional context to reproduce
Using flytekit v1.2.0b0 (There was a recent fix for a type conversion problem that seemed related, but the issue persists)
Could be related to #2775, but I tried using the new flytekit version without success
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: