• m

    Matej

    1 year ago
    Hi i am going through the tutorials andhttps://docs.prefect.io/core/examples/mapping.html
    from prefect import task
    
    @task
    def add(x, y):
        return x + y
    
    add(1, 2)  # 3
    this example throws me:
    ValueError: Could not infer an active Flow context while creating edge
    and suggests using add.run() instead. In the tutorial however, they use add(1,2) regularly. Are the tutorials outdated for the newest version of prefect? edit: I am also unable to use .map as it is used in the tutorial:
    add.map([1, 10], [2, 3])
    throws the same error? How am I supposed to experiment with tasks without flow context?
    m
    1 replies
    Copy to Clipboard
  • m

    Matej

    1 year ago
    One more question, does prefect support looping of a subflow? that a part of the flow is repeated? It seems loop only works on a single task, what I have in mind is that I could loop through a chain of tasks.
    m
    a
    3 replies
    Copy to Clipboard
  • Mark McDonald

    Mark McDonald

    1 year ago
    We're seeing duplicate flow runs scheduled in Prefect Cloud. This flow id, for example, is currently duplicated: 5842f8d7-2f86-4c92-a291-3fcc87e6fbf7
    Mark McDonald
    Jenny
    8 replies
    Copy to Clipboard
  • Pedro Machado

    Pedro Machado

    1 year ago
    Hi there. I am trying to use docker storage with a custom Dockerfile that is based on an image that contains a conda environment. I am having an issue with the health checks failing, but the flow itself runs. Can you tell if I am doing something wrong? More details in thread.
    Pedro Machado
    Michael Adkins
    4 replies
    Copy to Clipboard
  • Stéphan Taljaard

    Stéphan Taljaard

    1 year ago
    Hi. Any issues with using poetry for dependency management (for Server + Agent on a single node)? Here and there there seems to have been issues, but besides potentially this, I can't see any reason to not use poetry?
    Stéphan Taljaard
    1 replies
    Copy to Clipboard
  • e

    Elliot Oram

    1 year ago
    Hey folks is anyone else getting a deprecation warning on marshmallow? Something like:
    ...
    /home/rof/.pyenv/versions/3.9.1/lib/python3.9/site-packages/marshmallow/fields.py:198
    /home/rof/.pyenv/versions/3.9.1/lib/python3.9/site-packages/marshmallow/fields.py:198: RemovedInMarshmallow4Warning: Passing field metadata as a keyword arg is deprecated. Use the explicit `metadata=...` argument instead.
    ...
    Tried to update to the latest version of prefect and still no joy!
    e
    Noah Holm
    +1
    9 replies
    Copy to Clipboard
  • Domantas

    Domantas

    1 year ago
    Hello prefect, I'm trying to use secrets which are saved in the kubernetes. To access them, I'm using KubernetesRun agent parameter:
    job_template_path
    where there is a path to yaml file which is supposed to create environment variables and used them in the prefect code:
    apiVersion: v1
    kind: Pod
    metadata:
      name: secret-test-pod
    spec:
      containers:
        - name: test-container
          image: <http://k8s.gcr.io/busybox|k8s.gcr.io/busybox>
          command: [ "/bin/sh", "-c", "env" ]
          envFrom:
          - secretRef:
              name: mysecret
      restartPolicy: Never
    Yaml file template is took from kubernetes documentation(https://kubernetes.io/docs/concepts/configuration/secret/#use-cases) However, when I try to run it on prefect server, I got this error:
    "'spec'"
    (will attach an error log screenshot) Is there are anything wrong with the template? Is this approach is a good way to define and use secrets in the kubernetes agent? P.S I tried to define
    env
    parameter with secrets by using KubernetesRun agent but it is not a good option for this case since all secrets could be visible as a plain text in the prefect server UI.
    Domantas
    davzucky
    2 replies
    Copy to Clipboard
  • Pedro Machado

    Pedro Machado

    1 year ago
    Hi everyone. I am reposting this message from Sunday which may be overlooked. Thanks for your help!
    Pedro Machado
    Kevin Kho
    5 replies
    Copy to Clipboard
  • Zach Schumacher

    Zach Schumacher

    1 year ago
    When i specify a
    job_template
    in my
    KubernetesRun
    config, I’m stilling seeing default set in the UI. I believe previously I would see the template there. Anyone know what is going on? We are running prefect cloud and my core version is
    0.14.19
    Zach Schumacher
    Kevin Kho
    +1
    7 replies
    Copy to Clipboard
  • t

    Trevor Kramer

    1 year ago
    I have a mapped task that needs to wait until a previous mapped task is 100% complete before starting. If I add upstream_tasks=[fp_validation_predicted_locations] it kicks off task 1 when task 1 of fp_validation_predicted_locations finishes. How can I have it wait until they are all finished? Can I do upstream_tasks=[unmapped(fp_validation_predicted_locations)]?
    t
    Kevin Kho
    14 replies
    Copy to Clipboard