Hey everyone. I have a need to use the PostgresExe...
# ask-community
a
Hey everyone. I have a need to use the PostgresExecute task to run a specific function call, but the host/user/password that it runs for is determined dynamically during flow execution. It seems like this isn't possible due to how the task is setup
k
Hey @Adam Brusselback, looks like you are 100% right. There is an outstanding issue for this. We’d certainly welcome a PR if you are interested. Otherwise, my best advice for now would be to subclass the task and override the
run()
method to be configurable.
1
a
Alright, @Kevin Kho with that link I remembered I looked into this already 6 months ago and had commented on that issue (as Tostino). This now is blocking progress for me, so I sat down and fixed the postgres tasks. Will submit a pull request shortly
k
I felt this sounded familiar!
a
Hmm, when creating the PR, do I need to do something with the /changes dir?
Ahh well, opened it and will make any changes as requested: https://github.com/PrefectHQ/prefect/pull/5016
k
Already looks good to me but I guess we'll let the core team review. The
changes
dir is for you to put a changelog entry and optionally your name
Random thought, is
tuple
annotation only python 3.8 and up? I think it's not available in python 3.7? But I'm not really sure. I think it still needs to be import
from typing import Tuple
a
Hmm, it was already used in the PostgresExecute and that line was unchanged by me, the line I changed from list to tuple, that is a copy paste issue...appreciate you catching that.
k
Ah I see