• Lukáš Pravda

    Lukáš Pravda

    5 months ago
    Hello community, I’d like to test a rather simple scenario whether a task defined in a flow was run, but I dont seem to understand how to mock it properly. In simplicity my setup is similar to: file.py
    @task
    def foo():
        ....
    
    @task
    def bar():
        ....
    
    with Flow() as flow:
       try:
           foo()
       except:
           bar()
    test.py
    from file import flow
    from unittest.mock import patch
    
    @patch("file1.bar")
    @patch("file.foo")
    def test_flow(mock1,  mock2):
        mock.side_effect = Exception("throw an error")
    
       flow.run()
    
       assert mock2.assert_called_once()
    but the mock is never called, have found this:
    <https://github.com/PrefectHQ/prefect/issues/1801>
    , but could not really mount that solution to my exact problem. What am I missing? Thank you
    Lukáš Pravda
    Kevin Kho
    3 replies
    Copy to Clipboard
  • Tom Manterfield

    Tom Manterfield

    5 months ago
    On the Orion beta, I can’t see any route to adding GCP credentials to a
    KubernetesFlowRunner
    instance other than building the keys into the image itself. Has anyone else found a solution for this?
    Tom Manterfield
    Michael Adkins
    7 replies
    Copy to Clipboard
  • Xavier Babu

    Xavier Babu

    5 months ago
    We are not using any deployment container like Docker. We use the storage just mounted in the Linux Server. How can we create a local storage for prefect instead of using /tmp. When I run the the command "prefect storage create" I don't get any list to choose for storage type and whatever value I put, it says "invalid selection". Please help. Found the following storage types: Select a storage type to create: 4 Invalid selection 4
    Xavier Babu
    Kevin Kho
    +1
    104 replies
    Copy to Clipboard
  • k

    Kathryn Klarich

    5 months ago
    Hi all, I’m not sure where the best place to post this is (here versus discourse), but I am running into an error when trying to register a prefect flow:
    AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
    - it seems to be happening during this step
    RUN pip install pip --upgrade
    - has anyone come across this before and know how to fix it? I was able to successfully register this flow a few days ago and haven’t changed much in the requirements since then.
    k
    Kevin Kho
    +1
    27 replies
    Copy to Clipboard
  • Bradley Hurley

    Bradley Hurley

    5 months ago
    Hi Prefect Experts - Is it possible if I have a flow run thats in a failed/cancelled state, to clear the state of a task thats already succeeded so that when the flow is restarted the previously successful task will re-execute? I know you can do that sort of thing with Airflow, but wasn't able to replicate with Prefect.
    Bradley Hurley
    Kevin Kho
    +1
    13 replies
    Copy to Clipboard
  • j

    Jai P

    5 months ago
    hey all! question about the eventual introduction of the
    case
    statement in prefect 2.0: is there a rough timeline for when that may be introduced? Also, are there any major differences that are planned between how they work in prefect 1.0, where i think you can only conditionally go between tasks (to, say, possibly supporting subflows)?
    j
    Anna Geller
    +1
    17 replies
    Copy to Clipboard
  • Anna Geller

    Anna Geller

    5 months ago
    Hi, Prefectionists! 👋 Want to chat about best practices in workflow orchestration? We've just created a new channel #best-practices-orchestration. Especially as we continue to iterate on Prefect 2.0 to be the best workflow orchestration engine everyone will love working with, we welcome a dialogue about best practices and your expectations! 😛refect2: :cloud2: Also, if you want to chat about various trends in the data industry or share some tricks to work with data more efficiently, the new channel #data-tricks-and-tips is the best place to start a conversation. Lastly, to celebrate how :marvin-duck: conquers the world, we started a channel #marvin-in-the-wild posting pictures from places Marvin has visited so far. Make sure to join the channels - we are excited about all data and workflow orchestration chats. Happy Engineering!
  • s

    Slackbot

    5 months ago
    This message was deleted.
    s
    Kevin Kho
    2 replies
    Copy to Clipboard
  • d

    Dylan

    5 months ago
    Have a few questions on flow boilerplate and k8's templates
    d
    Kevin Kho
    6 replies
    Copy to Clipboard
  • m

    Michael Moscater

    5 months ago
    Hello, is it possible to have a parent flow run a mapped create_flow_run task with a flow and multiple parameters, so the the created flows would be able to use the different parameters passed?
    m
    Kevin Kho
    7 replies
    Copy to Clipboard