Skip to content

Commit 64b58ec

Browse files
wirchodbeatty10
andauthored
Default parse-time nodes' raw_code property to "" (empty string) to comply with strict str type (#11884)
* Default parse-time nodes' raw_code property to "" (empty string) to comply with strict str type * Changelog entry --------- Co-authored-by: Doug Beatty <[email protected]>
1 parent 1e713db commit 64b58ec

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Fixes
2+
body: Comply with strict `str` type when `block.contents` is `None`
3+
time: 2025-08-04T07:42:54.612616-06:00
4+
custom:
5+
Author: wircho
6+
Issue: "11492"

core/dbt/parser/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def _create_parsetime_node(
244244
"path": path,
245245
"original_file_path": block.path.original_file_path,
246246
"package_name": self.project.project_name,
247-
"raw_code": block.contents,
247+
"raw_code": block.contents or "",
248248
"language": language,
249249
"unique_id": self.generate_unique_id(name),
250250
"config": self.config_dict(config),

0 commit comments

Comments
 (0)