-
Notifications
You must be signed in to change notification settings - Fork 155
Added Support for variable library creation and update #954
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
base: main
Are you sure you want to change the base?
Conversation
…ionality - Updated `requires-python` to allow Python 3.13. - Added support for Python 3.11 and 3.12 in classifiers. - Expanded `__all__` in `__init__.py` to include new variable library functions. - Introduced `_encode_b64` and `_create_variable_library_definition` functions in `_functions.py` updated with create and update variable libraries
| Parameters | ||
| ---------- | ||
| variables : List[Dict], optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of 'optional', use default=None. You can see this is the standard across semantic link labs.
| Returns | ||
| ------- | ||
| str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no point in returning a string
| status_codes=[200], | ||
| ) | ||
|
|
||
| if response.status_code == 200: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please follow the convention for other such functions. no need for an if statement here. just print that the variable library was updated successfully. if an issue occurred, an error would be caught by _base_api.
| lro_return_json=False, | ||
| ) | ||
|
|
||
| if response.status_code == 200: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as before, don't need these if statements.
|
While the update definition function is fine, it may be useful to have functions like 'set_variable' where one can add/update an existing variable definition. And along the same lines, set_value_set. That would make adding/updating a variable much easier than trying to do it via updating the entire definition. |
|
I'll update the code with the fixed and suggestions, thanks @m-kovalsky |
requires-pythonto allow Python 3.13.__all__in__init__.pyto include new variable library functions._encode_b64and_create_variable_library_definitionfunctions in_functions.pyupdated with create and update variable librariesTested and validated :
Test example :