Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support optional values during non-preview run #414

Closed
andrzejressel opened this issue Sep 23, 2024 · 0 comments · Fixed by #430
Closed

Support optional values during non-preview run #414

andrzejressel opened this issue Sep 23, 2024 · 0 comments · Fixed by #430

Comments

@andrzejressel
Copy link
Owner

Currently all null values from Pulumi are treated as Nothing which is correct during preview, but incorrect during non-preview.

Test case:

Index: examples/simple/src/lib.rs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/examples/simple/src/lib.rs b/examples/simple/src/lib.rs
--- a/examples/simple/src/lib.rs	(revision 00e265730b313e9dcd331ec220c49f5844766964)
+++ b/examples/simple/src/lib.rs	(date 1727119217354)
@@ -19,6 +19,9 @@
     // Tests number mapping
     let number = random_string.min_upper.map(|i| i * 2);
 
+    // Optional values are deserialized as None
+    let keepers = random_string.keepers.map(|map| format!("Keepers: {map:?}"));
+    
     let val1 = Output::new(&1);
     let val2 = Output::new(&"abc".to_string());
 
@@ -34,5 +37,6 @@
     add_export("number", &number);
     add_export("combined_string", &combined_string);
     add_export("combined_2_string", &combined_2_string);
+    add_export("keepers", &keepers);
     Ok(())
 }

keepers output is not shown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant