Skip to content
New issue

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

Missing artifact in the step.task.data._artifacts #1768

Open
super-shayan opened this issue Mar 19, 2024 · 1 comment
Open

Missing artifact in the step.task.data._artifacts #1768

super-shayan opened this issue Mar 19, 2024 · 1 comment

Comments

@super-shayan
Copy link

Hello, I am using Metaflow and scheduling parallel jobs on AWS Step function. My Flow script is as follows:

start() -> run() -> join() -> end()
in the start() i am using foreach to call run() in parallel. I tried using the Client API to access the data in the run() step, as follows:

flow = Flow('MyFlow')
step = Step('MyFlow/sfn-id/run')
list(step.tasks())#there are multiple of these available, i choose one below:
step.task#is something like: MyFlow/sfn-id/run/task-id
step.task.data#gives the output: <MetaflowData: >

Since I have attached a variable called "self.results" to the run() step, I expected to access the results by calling the following:
step.task.data.results, but this raises a keyError:

File /anaconda3/lib/python3.11/site-packages/metaflow/client/core.py:738, in MetaflowData.__getattr__(self, name)
    737 def __getattr__(self, name: str):
--> 738     return self._artifacts[name].data

KeyError: 'results'

I also tried to see what artifacts are there by calling:

step.task.data._artifacts
but that returns a Null set

@savingoyal
Copy link
Collaborator

correct - you might be running into this expected behavior. The link has details on how to correctly move state through a foreach. Let me know if that works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants