• Constantino Schillebeeckx

    Constantino Schillebeeckx

    9 months ago
    I'm trying to do a conditional flow like the one shown below:
    @task
    def check_cond():
        return False
    
    
    @task
    def run_task(anchor_date, days_from):
    
        logger = prefect.context.logger
        logger.critical(f"{days_from=}")
    
    
    with Flow('foo') as flow:
    
        anchor_date = Parameter(name="anchor_date", default=None)
        cond = check_cond()
    
        with case(cond, True):
            anchor_date = run_task(anchor_date, days_from=0)
    
        with case(cond, False):
            anchor_date = run_task(anchor_date, days_from=-1)
    however the
    False
    condition never gets run. When
    check_cond
    returns
    True
    - the flows runs as expected. Am I missing something?
    Constantino Schillebeeckx
    Kevin Kho
    18 replies
    Copy to Clipboard
  • Chris Reuter

    Chris Reuter

    9 months ago
    Join us

    on Youtube

    in 5 minutes for a FIREsaleside Chat with @Jeremiah and @Chris White! We'll be discussing 🔥 topics and, as promised, The Matrix 4 (I'm not joking).
  • Danny Vilela

    Danny Vilela

    9 months ago
    Hi — when is the
    today
    template filled in a result
    location
    or task
    target
    string? I keep getting a KeyError:
    from prefect.engine.results import LocalResult
    
    # Create a new local result pointing to current working directory.
    result = LocalResult(dir=".", location="{today}.txt")
    assert result.location == "{today}.txt"
    
    # This raises `KeyError: 'today'`.
    result.write(value_="hello!")
    I’m following this doc: https://docs.prefect.io/core/concepts/results.html#choose-a-serializer (under “Templating
    Result
    locations”)
    Danny Vilela
    Kevin Kho
    8 replies
    Copy to Clipboard
  • o

    Ovo Ojameruaye

    9 months ago
    Hi, I am experiencing some weird behavior using prefect server. I can run a flow on prefect core, it executes completely but when I spin up the UI and run the exact same flow on a local agent (same machine and environment), I get an ModuleNotFoundError. I have modules I import as part of my flow
    o
    Kevin Kho
    +2
    9 replies
    Copy to Clipboard
  • Danny Vilela

    Danny Vilela

    9 months ago
    Is there a way to reference a task output in a result
    location
    or task
    target
    ? I know the Prefect context gives you a bunch of variables – notably including
    parameters
    , which looks promising! – but what if we have some data (the strings
    "foo"
    or
    "bar"
    ) computed by some task
    compute_foo_or_bar
    and we’d like to reference that output in a subsequent task’s output target?
    Danny Vilela
    Kevin Kho
    4 replies
    Copy to Clipboard
  • j

    Jelle Vegter

    9 months ago
    Hey all, my docker agent stopped being able to auth (error 500) to my Gitlab storage. I don't think I changed anything to the Prefect Agent/Gitlab settings so I don't know what caused it. Any ideas?
    j
    Anna Geller
    7 replies
    Copy to Clipboard
  • Alejandro Sanchez Losa

    Alejandro Sanchez Losa

    9 months ago
    hi guys i am not sure I am using correctly prefect … anyone know where I can buy a course to learn more easy and deeply about prefect and best practices ?
    Alejandro Sanchez Losa
    Anna Geller
    2 replies
    Copy to Clipboard
  • o

    Ovo Ojameruaye

    9 months ago
    Hi everyone, I am running prefect server on my linux and I want someone else in my team to be able view the UI on their own machine. Typically to do this, I simply share <IP>:<port_number> and this works like a charm (I do this with airflow and streamlit while testing). We are on the same network. I tried the same for prefect (<IP>:8080) but it can't be reached. I am still learning about prefect and not sure why this behavior is different. Would appreciate any help Update: I tried to start a local agent from a different machine and I get
    ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
    . I can't tell if this is related. I created a config.toml file
    # base configuration directory 
    home_dir = "C:/Users/XXX/.prefect"
    
    backend = "server"
    
    [server]
    host = "<http://XXXXXX>"
    port = "4200"
    host_port = "4200"
    endpoint = "${server.host}:${server.port}"
    I am certain the server is running on the host ip address
    o
    Anna Geller
    8 replies
    Copy to Clipboard
  • Anh Nguyen

    Anh Nguyen

    9 months ago
    Hi all! how to kick-off flow defend on another flow is success? Thanks
    Anh Nguyen
    1 replies
    Copy to Clipboard
  • y

    Yash

    9 months ago
    Hi, is there any prefect graphql api video tutorial or blog posts.. Thanks!!!
    y
    Anna Geller
    3 replies
    Copy to Clipboard