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
I am facing issues when trying to return a tuple or an object, to return multiple value for a step, which is quite a common practice
@is_fairstep(label='Load data', is_script_task=True) def load_data(): data, y = load_iris(return_X_y=True, as_frame=True) return data, y @is_fairworkflow(label='My model training workflow') def training_workflow(n_jobs: int): data, y = load_data()
I am getting this error:
Traceback (most recent call last): File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 502, in _validate_decorated_function result = func(*empty_args) File "my-model/src/my_model/train.py", line 83, in training_workflow data, y = load_data() File "python3.9/site-packages/noodles/interface/decorator.py", line 276, in __iter__ raise TypeError( TypeError: You have tried to iterate (or unpack) a PromisedObject. There is currently no possible way to learn the length of a PromisedObject so, sadly, this is not implemented. You may use the `noodles.unpack` function to unpack a promised tuple. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "my-model/src/my_model/train.py", line 75, in <module> def training_workflow(n_jobs: int): File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 482, in _modify_function _validate_decorated_function(func, empty_args) File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 504, in _validate_decorated_function raise TypeError("Marking the function as workflow with `is_fairworkflow` decorator " TypeError: Marking the function as workflow with `is_fairworkflow` decorator failed. Did you use the is_fairstep decorator on all the steps? Detailed error message: You have tried to iterate (or unpack) a PromisedObject. There is currently no possible way to learn the length of a PromisedObject so, sadly, this is not implemented. You may use the `noodles.unpack` function to unpack a promised tuple.
noodle.unpack
from noodles import unpack @is_fairstep(label='Load data', is_script_task=True) def load_data(): data, y = load_iris(return_X_y=True, as_frame=True) return data, y @is_fairworkflow(label='My model training workflow') def training_workflow(n_jobs: int): data, y = unpack(load_data(), 2)
Traceback (most recent call last): File "my-model/src/my_model/train.py", line 76, in <module> def training_workflow(n_jobs: int): File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 487, in _modify_function workflow_level_promise._fairworkflow = FairWorkflow.from_noodles_promise( File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 107, in from_noodles_promise steps_dict = {i: n.foo._fairstep for i, n in workflow.nodes.items()} File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 107, in <dictcomp> steps_dict = {i: n.foo._fairstep for i, n in workflow.nodes.items()} AttributeError: 'function' object has no attribute '_fairstep'
@is_fairstep(label='Load data', is_script_task=True) def load_data(): data, y = load_iris(return_X_y=True, as_frame=True) return { "data": data, "y": y }
I am getting the following error:
Traceback (most recent call last): File "my-model/src/my_model/train.py", line 75, in <module> def training_workflow(n_jobs: int): File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 487, in _modify_function workflow_level_promise._fairworkflow = FairWorkflow.from_noodles_promise( File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 107, in from_noodles_promise steps_dict = {i: n.foo._fairstep for i, n in workflow.nodes.items()} File "python3.9/site-packages/fairworkflows/fairworkflow.py", line 107, in <dictcomp> steps_dict = {i: n.foo._fairstep for i, n in workflow.nodes.items()} AttributeError: 'function' object has no attribute '_fairstep'
@raar1 what would be the recommended to pass multiple objects in a fairstep return statement?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am facing issues when trying to return a tuple or an object, to return multiple value for a step, which is quite a common practice
I am getting this error:
noodle.unpack
:I am getting this error:
I am getting the following error:
@raar1 what would be the recommended to pass multiple objects in a fairstep return statement?
The text was updated successfully, but these errors were encountered: