MCPcopy Index your code
hub / github.com/feast-dev/feast / _escape_description

Function _escape_description

sdk/python/feast/dbt/codegen.py:170–175  ·  view source on GitHub ↗

Escape a description string for use in Python code.

(desc: Optional[str])

Source from the content-addressed store, hash-verified

168
169
170def _escape_description(desc: Optional[str]) -> str:
171 """Escape a description string for use in Python code."""
172 if not desc:
173 return ""
174 # Escape quotes and newlines
175 return desc.replace("\\", "\\\\").replace('"', '\\"').replace("\n", " ")
176
177
178class DbtCodeGenerator:

Callers 6

test_quotes_escapedMethod · 0.90
generateMethod · 0.85

Calls

no outgoing calls

Tested by 5

test_quotes_escapedMethod · 0.72