Commit Graph

18 Commits

Author SHA1 Message Date
Fraser Waters bba69e2f38 Make `Output.from_input` recurse into tuples.
Fixes https://github.com/pulumi/pulumi/issues/6635.
2023-07-27 10:13:40 +01:00
bors[bot] 772a057ee1
Merge
13463: Fix links to outputs docs r=cnunciato a=cnunciato

Fixes some broken links pointing to the Inputs & Outputs docs.

Fixes .

Co-authored-by: Christian Nunciato <chris@nunciato.org>
2023-07-13 12:34:13 +00:00
Fraser Waters 8db3087d2b Make pythons RPCManager a context variable 2023-07-13 09:59:12 +01:00
Christian Nunciato 202fbd946f Fix links outputs docs 2023-07-12 14:59:07 -07:00
Fraser Waters 5685291373 Handle Outputs in dict keys passed to from_input 2023-01-27 04:51:05 +00:00
Fraser Waters ecaee6eeba Fix a TypeError in Output.from_input 2023-01-13 18:14:50 +00:00
Fraser Waters 9961796909 Add json_loads to python sdk
Partner method to json_dumps.
2022-12-28 20:24:07 +00:00
Fraser Waters 2ffdcd0322 Add json_dumps to python sdk 2022-12-14 13:53:15 +00:00
Fraser Waters c63813e0bc Add Output.format to python SDK 2022-10-04 22:45:49 +01:00
Kyle Pitzen 122d7c25b9
fix(sdk/python): Makes SETTINGS attributes context-aware () 2022-08-23 13:45:37 -04:00
Guinevere Saenger bbbab1c9a1
Correct Python syntax in help text ()
* Correct Python syntax in help text

Replace arrow with colon, as is correct for Python

* fix test
2022-08-15 18:03:15 +01:00
Anton Tayanovskyy ef97271249
Fix Python SDK apply causing program hangs ()
* Fix Python SDK apply causing program hangs

* PR feedback
2022-08-15 10:43:10 -04:00
Fraser Waters cd2a0b7934
Fix typo in __str__ error message ()
* Fix typo in __str__ error message

* Fix test
2022-06-24 22:45:19 +01:00
Fraser Waters 6bbe7f6071
Change str(output) to return a warning message ()
* Change str(output) to return a warning message

* Update CHANGELOG
2022-06-13 16:08:13 +01:00
Luke Hoban 965d23ba2a
[sdk/python] Ensure Output objects are not iterable ()
Although `Output` objects can never correct support iteration, Python will see the implementation of `__getitem__` and try to iterate the object, leading to an infinite loop.  To prevent this, we need to explicitly implement `__iter__` and make it return a `TypeError` to prevent iteration (and offer a useful error message).

Fixes .
2021-06-15 09:25:24 +10:00
Luke Hoban 26e252f241
Ensure `Output.from_input({})` returns `{}` instead of `[]` ()
Fixes .
2021-06-09 19:48:10 +10:00
Luke Hoban bd6410e2fb
[sdk/python] Avoid exponential complexity for `from_input`/`all` ()
These mutually recursive functions unintentionally had exponential complexity in nesting depth of objects, arg types and most likely arrays.

Remove the exponential complexity by avoiding direct recursion of from_input on itself, and relying on mutual recursion with all alone to reduce nested substructure.

Also simplify the implementation to aid readability.

Fixes pulumi/pulumi-kubernetes#1597.
Fixes pulumi/pulumi-kubernetes#1425.
Fixes pulumi/pulumi-kubernetes#1372.
Fixes .
2021-06-01 13:11:22 +10:00
Justin Van Patten 2779de38ea
[sdk/python] from_input: Unwrap nested outputs in input types ()
`Output.from_input` deeply unwraps nested output values in dicts and lists, but doesn't currently do that for the more recently added "input types" (i.e. args classes). This leads to errors when using args classes with output values with `Provider` resources, which uses `Output.from_input` on each input property and then serializes the value to JSON in an `apply`. This changes fixes `Output.from_input` to recurse into values within args classes to properly unwrap any nested outputs.
2021-01-29 15:44:00 -08:00