snowflake.core.service.ServiceSpec¶
- snowflake.core.service.ServiceSpec(spec: str, force_inline: bool = False) ServiceSpecInlineText | ServiceSpecStageFile¶
Infer whether a specification is a stage file or inline text.
Any spec that starts with ‘@’ is parsed as a stage file, otherwise it is passed as an inline text.
Note: this function infers inline-text vs. stage-file handling from the first character of
spec. Ifspecmay contain untrusted input and your application expects the inline-text branch, passforce_inline=Trueto guarantee inline-text handling regardless of the string’s content, while still getting this function’s YAML validation and normalization.- Parameters:
spec (str) – The specification to parse, either a stage file path prefixed with
'@'or inline YAML text.force_inline (bool, optional) – If
True, always treatspecas inline text and validate it as such, even if it starts with'@'. Defaults toFalse.
- Returns:
A
ServiceSpecStageFileifspecstarts with'@'andforce_inlineisFalse, otherwise aServiceSpecInlineText.- Return type: