<@ULVA73B9P> Are there any limitations on adding t...
# ask-marvin
k
@Marvin Are there any limitations on adding tags to deployments? For example, only lowercase letters, no spaces, etc.
m
thought for 330.0 seconds
Short answer: In Prefect 3.x, there are no special character restrictions on deployment tags. Details: - Allowed characters: anything you can put in a string (letters, numbers, spaces, punctuation, Unicode) is fine - Case: case-sensitive (
Prod
and
prod
are different) - Spaces: allowed - Length and count: no explicit limits enforced by the API/DB - Type coercion: non-strings are coerced to strings - Empty strings: whitespace-only/empty items may be filtered out when using certain client helpers, but generally not by the API - No automatic de-duplication: duplicates are stored as provided If you want to enforce your own convention (e.g., lowercase, no spaces), normalize before passing tags:
Copy code
raw_tags = ["Prod", "data science", "  "]
tags = sorted({t.strip().lower().replace(" ", "-") for t in raw_tags if t and t.strip()})
# tags -> ['data-science', 'prod']
If you’re on Prefect 2.x instead, let me know and I can call out any small differences, but the high-level behavior is similar.
k
@Marvin So in the
prefect.yaml
file,
tags: [Sales, ABC Company]
would be fine?
m
thought for 165.0 seconds
Yes — that’s valid in Prefect 3.x. In prefect.yaml you can write:
Copy code
tags: [Sales, ABC Company]
Both tags will be preserved exactly as written (including the space in
ABC Company
). Prefect only filters out empty/whitespace-only entries and otherwise accepts any characters; there’s no lowercase-only rule and no need to quote strings with spaces.