Commit 810e466
committed
Raise an error when a placeholder is used in an f-string or .format() call.
This is a common mistake that can lead to confusing errors, because when combined with surrounding strings, it can lead to invalid values like `--data_path=input:<tfx.dsl.placeholder.placeholder.ArtifactPlaceholder\ object\ at\ 0x7f42d66671f0>/filename.txt`. The component implementation might receive as an argument in a place where it normally expects a proper file path, causing it to print weird errors or even read an empty file instead, depending on its implementation.
Note: If you actually intend to print the placeholder to the developer/console, use `repr()` instead.
PiperOrigin-RevId: 6408898821 parent baab834 commit 810e466
File tree
4 files changed
+16
-2
lines changed- tfx
- dsl
- experimental/conditionals
- placeholder
- types
4 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
0 commit comments