this example throws me:
from prefect import task @task def add(x, y): return x + y add(1, 2) # 3
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:
ValueError: Could not infer an active Flow context while creating edge
throws the same error? How am I supposed to experiment with tasks without flow context?
add.map([1, 10], [2, 3])
Tried to update to the latest version of prefect and still no joy!
... /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. ...
where there is a path to yaml file which is supposed to create environment variables and used them in the prefect code:
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:
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
(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
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.
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