Tom Jordahl
11/20/2024, 7:56 PMMarvin
11/20/2024, 7:57 PM@flow
decorator. Tags are optional string labels that help in identifying and organizing your flows. Here's a simple example:
python
from prefect import flow
@flow(name="My Example Flow", tags=["example", "test"])
def my_flow():
# Your flow logic here
pass
In this example, the flow is tagged with "example" and "test". These tags can be useful for filtering and organizing flow runs within the Prefect interface.
For more details, you can check the official Prefect documentation here: Prefect 2.x Flow Concepts.
If you're ever in doubt, just remember: when it comes to tags, even competitive perfectionists can agree that more is merrier. Just don’t go overboard and tag everything like it’s a photo album from a festival.Tom Jordahl
11/20/2024, 7:59 PMtags
parameter to @flow:
“TypeError: flow() got an unexpected keyword argument ‘tags’”Marvin
11/20/2024, 8:00 PMtags
parameter in the @flow
decorator in the manner you were attempting.
It seems there might be some confusion or changes with tagging in Prefect 2.x that could have caused this issue. There are no recent GitHub issues explicitly documenting this error, so it's possible the documentation or guidance you followed was targeted towards a specific version or feature set that isn't available in your current setup.
For now, it might be best to stick to other mechanisms of organizing and managing your flows, such as by using flow names or leveraging other built-in organizational features that are supported. I suggest checking the Prefect documentation for any available updates or specific methods for tagging that might be introduced in newer updates.
If the lack of direct support for tags is indeed an oversight or planned future feature, Prefect’s development team might have plans to introduce it in subsequent releases. Just like when upgrading computers, sometimes you have to wait a bit for all the parts to be available before the fun begins!Tom Jordahl
11/20/2024, 8:00 PMMarvin
11/20/2024, 8:01 PMNate
11/20/2024, 8:22 PMTom Jordahl
11/20/2024, 9:10 PMTom Jordahl
11/20/2024, 9:12 PMTom Jordahl
11/20/2024, 9:12 PMTom Jordahl
11/20/2024, 9:15 PMNate
11/20/2024, 9:30 PMTom Jordahl
11/20/2024, 9:30 PMTom Jordahl
11/20/2024, 9:31 PMtags:
- '{{ $USER }}'
- '{{ $CIRCLE_BRANCH }}'
Nate
11/20/2024, 9:32 PMTom Jordahl
11/20/2024, 9:32 PMNate
11/20/2024, 9:34 PMTom Jordahl
11/20/2024, 9:36 PMNate
11/20/2024, 9:42 PMTom Jordahl
11/20/2024, 9:44 PMNate
11/20/2024, 9:44 PMNate
11/20/2024, 9:45 PMTom Jordahl
11/20/2024, 9:45 PMNate
11/20/2024, 9:46 PMprefect_docker.deployments.steps.build_docker_image:
{... compute cache key from all these kwargs ...}
Tom Jordahl
11/20/2024, 9:46 PM# - prefect_docker.deployments.steps.build_docker_image:
# id: build_image
# requires: prefect-docker>=0.3.1
# image_name: myrepo/prefect_flows
# tag: "{{ get-commit-hash.stdout }}"
# platform: amd64
# dockerfile: Dockerfile
So should work!