feat(python): Update return type for 'get_resource' function (#2695)

* Update return type for 'get_resource' function

Modified the 'get_resource' function in 'wmill/client.py' to additionally return a 'dict', providing support for dictionaries in addition to strings and None. This change caters towards use-cases where getting a dictionary resource is needed, enhancing flexibility of resource handling in Windmill client operations. Code updated in two locations for consistency.

* Update README.md for python-client

Expanded and updated the 'README.md' to include detailed explanations about the basic and advanced usage of the 'wmill' package. The previous version wasn't as comprehensive and lacked examples. Now it includes thorough usage guidance, additional explanations, and code examples. Change improves usability for new developers approaching the project.
This commit is contained in:
Stephan Fitzpatrick
2023-11-24 11:17:30 -08:00
committed by GitHub
parent a69eefc62e
commit aeb8ee4d7b
2 changed files with 75 additions and 20 deletions
+2 -2
View File
@@ -253,7 +253,7 @@ class Windmill:
self,
path: str,
none_if_undefined: bool = False,
) -> str | None:
) -> str | dict | None:
"""Get resource from Windmill"""
try:
return self.get(
@@ -567,7 +567,7 @@ def get_state() -> Any:
def get_resource(
path: str,
none_if_undefined: bool = False,
) -> str | None:
) -> str | dict | None:
"""Get resource from Windmill"""
return _client.get_resource(path, none_if_undefined)