Hello everyone,
I am trying to use PostgresExecute from the Task Library, but passing the user as a Parameter. The problem is that you can only pass the user when instantiating the task outside the flow object.
I have tried to make it work by using .run() in the parameter and creating the task inside the Flow, but I don't know if this is the best way. Is there a better way to do it?
k
Kevin Kho
08/16/2021, 1:53 PM
Hey @Nacho Rodriguez, you are right. Check this issue. In general, we are moving to having everything configurable by run (and some tasks have been edited already). This is something we’d appreciate contributions for also btw.
But to fix this, you can subclass the current PostgresExecute task and replace the run method with one that accepts all of the arguments.
Kevin Kho
08/16/2021, 1:55 PM
You would implement something like this . I can help with that if you have issues.
n
Nacho Rodriguez
08/16/2021, 2:51 PM
Okey than you for your help!
It looks like an easy fix in the source code (Just duplicating the init params in the run() method definition?).
I have never contributed to an open source project, how could I suggest a fix for this?
k
Kevin Kho
08/16/2021, 3:04 PM
Exactly yeah. We have instructions for that here and I can help you put it together when you have something. In general,
1. Fork the repo
2. Create your branch
3. Apply your changes
4. Run the tests
5. Open a Pull Request
Look at the MySQL task for a guide how to do this.
👀 1
Kevin Kho
08/16/2021, 3:06 PM
You can also see the PR that changed the MySQL Task here . It had the same problem.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.