question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manually created `Constant` task is not returned with `flow.tasks`

See original GitHub issue

Description

I have manually created a Constant task and added it to a Flow. However, the flow does not return it when I execute flow.tasks. Here is some code to replicate the bug:

from prefect import task, Flow
from prefect.tasks.core.constants import Constant

@task
def do_nothing(arg):
    pass

with Flow("constants") as flow:
    do_nothing(Constant({"x": 1, "y": [9, 10]}, name='asdf'))

flow.tasks

The code above returns: {<Task: do_nothing>}

Expected Behavior

I expected to have {<Task: do_nothing>, <Task: asdf>} returned as shown in this prefect tutorial in the “Auto-generation of Tasks” example

Environment

I am using prefect==0.8.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AndrewLim1990commented, Jan 13, 2020

Thanks for the help! I ended up using the first route you mentioned above. In my mind, perhaps a good route forward is to be able to be identified by name w/ flow.constants.

1reaction
AndrewLim1990commented, Jan 10, 2020

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Constant Tasks - Prefect Docs
Return an optional result. When this function runs successfully, the task is considered successful and the result (if any) can be made available...
Read more >
Common Salesforce Flow Errors and How to Troubleshoot Them
If your flow is running in user mode, an error will be returned. How do you know which context your flow is running...
Read more >
Dynamic Task Mapping — Airflow Documentation
Dynamic Task Mapping allows a way for a workflow to create a number of tasks at runtime based upon current data, rather than...
Read more >
Store and manage values in variables in Power Automate
Learn how to store, manage, use, and pass values by using variables in your flows.
Read more >
15 Working with Task Flow Activities
Restores a previous persistent save point, including application state and data, ... that points to a method, which takes no arguments and returns...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found