any ideas, hints, suggestions, links to articles t...
# prefect-community
w
any ideas, hints, suggestions, links to articles that could be of any help?
d
Also, we ❤️threads here, helps keep the main channel readable
w
@Dylan sorry bout that, my bad
d
No worries! 😄
Let me know if you have any further questions marvin
w
@Dylan thanks, I did find the article, but still couldn’t apply it to my use case. i do have the StartFlowRun and later the
with Flow('parent-flow') as flow
setting the upstreams
the comment says: “assumes you have registered the following flows”. isn’t it what I’m doing when I say
customer_flow = Flow('customer_flow')
?
d
Ahh, it is not
You need to create the flow and tasks and then call ‘flow.register()’
One moment
w
hm.. but even if i move the registration below everything, still get the same error (I do have the tasks refined above this code block) maybe I’m not setting 
dependencies
 in the context of the imperative api maybe they are required?
the imperative api example:
Copy code
from prefect import Task, Flow

# The tasks
class RunMeFirst(Task):
    def run(self):
        print("I'm running first!")

class PlusOneTask(Task):
    def run(self, x):
        return x + 1

# Instanciates the Flow
flow = Flow('My Imperative Flow')

# The task instance (I'm using the decorator format), this is where I get the error
plus_one = PlusOneTask()

# I don't have that.
flow.set_dependencies(
    task=plus_one,
    upstream_tasks=[RunMeFirst()],
    keyword_tasks=dict(x=10))

flow.visualize()
d
I’m not sure if those case statements are being set correctly with the imperative api
Since they are themselves tasks
I think the context manager is only available within a flow context block
like this
Copy code
with Flow("my flow") as flow:
  result = my_task()
  with case(result, True):
    #do something
w
i think i got that from the docs but let me double check. the error appear in my second line (check_status task), do you think that the case statements must be interfering?
d
I’m not as familiar with the imperative api
w
fair enough, let me try to adapt to the functional
d
You’ll need to register the parent as well
w
yes yes yes, I realized I was making a stupid mistake, lol
cool, seems to work with the functional approach. thanks a lot mate!
d
anytime! And Happy Holidays 😄
w
i’ll keep digging around, currently building a POC for an integration we have with about 10-15 different ERP systems that have to run every 1-5 minutes with different query for each system and each client. is been a nightmare to manage it trhough procedures and linked servers, no visibility on the health of the system whatsoever. airflow didn’t do the trick, NiFi is a bit outdated and not very nice to work when you have tons of flows, so Prefect seems perfect for the job, happy to have found it!
d
Glad to hear it!! And welcome to the community prefect duck
w
thanks a lot! happy hollydays and thank you very much for your help, best!