Adam Brusselback

    Adam Brusselback

    11 months ago
    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
    Kevin Kho

    Kevin Kho

    11 months ago
    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.
    Adam Brusselback

    Adam Brusselback

    11 months ago
    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
    Kevin Kho

    Kevin Kho

    11 months ago
    I felt this sounded familiar!
    Adam Brusselback

    Adam Brusselback

    11 months ago
    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
    Kevin Kho

    Kevin Kho

    11 months ago
    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
    Adam Brusselback

    Adam Brusselback

    11 months ago
    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.
    Kevin Kho

    Kevin Kho

    11 months ago
    Ah I see