Ivar Zapata
02/25/2026, 12:37 PMMarvin
02/25/2026, 12:37 PMMarvin
02/25/2026, 12:42 PMField(description=...) (and in any docstrings that Prefect parses for descriptions).
Try one of these patterns for descriptions that must show double backslashes (e.g., UNC paths, regex, Windows paths):
from pydantic import BaseModel, Field
class Config(BaseModel):
# Use a raw string
unc_path: str = Field(
default=r"\\server\share\folder",
description=r"UNC path like \\server\share\folder"
)
# Or, escape backslashes explicitly
windows_path: str = Field(
default="C:\\Users\\name\\file.txt",
description="Windows path like C:\\Users\\name\\file.txt"
)
If you still see single backslashes after doing the above, could you share:
- Your Prefect version (Cloud/Server and UI build if possible)
- How you’re setting the description (Pydantic Field(description=...) vs docstring)
- A minimal reproducible snippet of the model/parameter
- A screenshot of how it appears in the dashboard
With that, I can reproduce and file a bug if needed.Ivar Zapata
02/25/2026, 12:56 PMdata_version_description = (
'Versión de los datos a usar. Si no se indica, se usará la versión más reciente. '
'Para ver la lista de versiones disponibles, consultar: '
f'{str(path2windows(settings.raw_path))}'
)
class DataVersionParameters(BaseModel):
data_version: Optional[str] = Field(
default=None,
description=data_version_description,
title='Versión de los datos'
)
When print(data_version_description) I get:
Versión de los datos a usar. Si no se indica, se usará la versión más reciente. Para ver la lista de versiones disponibles, consultar: \\san0101\IA_common$\INPUT\RAWMarvin
02/25/2026, 12:56 PMMarvin
02/25/2026, 1:00 PM\\ becomes \ during rendering.
- This matches what you’re seeing with the UNC path: \\san0101\IA_common$\INPUT\RAW → the leading \\ gets rendered as a single \.
Workarounds/fixes:
- Best: wrap the path in backticks so Markdown treats it as code and preserves the backslashes.
data_version_description = (
'Versión de los datos a usar. Si no se indica, se usará la versión más reciente. '
'Para ver la lista de versiones disponibles, consultar: '
f'`{str(path2windows(settings.raw_path))}`'
)
- Alternative if you can’t use backticks: double the backslashes for Markdown input (so it renders back to two). For example:
safe_path = str(path2windows(settings.raw_path)).replace("\\", "\\\\")
data_version_description = f'... consultar: {safe_path}'
This is only needed where the UI uses Markdown (flow/deployment descriptions).
Next steps:
- Can you confirm exactly where you see the single backslash — in the run form’s parameter help text or in the flow/deployment description area? A screenshot would help.
- If it’s in the parameter form (plain text renderer), I’ll reproduce on 3.4.8 and open a bug. If it’s in the deployment/flow description, the backticks fix above will solve it.Ivar Zapata
02/25/2026, 1:07 PMMarvin
02/25/2026, 1:07 PMMarvin
02/25/2026, 1:09 PM\\ → \.
Quick ways to make it display correctly now:
- Easiest: wrap the path in backticks so any Markdown renderer preserves it
data_version_description = (
'Versión de los datos a usar. Si no se indica, se usará la versión más reciente. '
'Para ver la lista de versiones disponibles, consultar: '
f'`{str(path2windows(settings.raw_path))}`'
)
- Or, pre-escape backslashes (works for Markdown-rendered UIs)
safe_path = str(path2windows(settings.raw_path)).replace("\\", "\\\\")
data_version_description = (
'Versión de los datos a usar. Si no se indica, se usará la versión más reciente. '
'Para ver la lista de versiones disponibles, consultar: '
f'{safe_path}'
)
- If you must show a leading UNC \\ exactly as two characters even under Markdown, a robust trick is to insert a zero‑width space between them (renders the same visually, prevents collapse):
safe_path = str(path2windows(settings.raw_path)).replace("\\\\", "\\\u200b\\")
data_version_description = f'... consultar: {safe_path}'
Could you also help me isolate whether it’s the backend or UI doing this?
- Open DevTools → Network, load the run form, and inspect the schema/parameters request. Check the description value for your parameter — does it show \\ or \?
- If the API returns \\ but the UI shows \, I’ll file a UI bug for the 3.4.8 build. A screenshot of the run form and the UI build/hash (Help → About) would be perfect.
- If the API already returns a single backslash, I’ll trace where the description is being transformed on the server side.
If upgrading Server is an option, moving to a newer 3.6.x Server (which includes a newer UI) may avoid this without workarounds. In the meantime, the backticks or pre-escape approach above should resolve it.