ni / nisystemlink-clients-python

Python API for interacting with a SystemLink Server, created and supported by NI.
https://ni.com/systemlink
MIT License
10 stars 14 forks source link

fix: Make SpecClient() work with default values for optional args #68

Closed santhoshramaraj closed 2 months ago

santhoshramaraj commented 2 months ago

What does this Pull Request accomplish?

Fix the bug where the SpecClient() result in error though the arg configuration is optional.

Why should this Pull Request be merged?

Enable users use SpecClient() when run in SLE Jupyter executions or with SystemLink Client without passing an HttpConfiguration except for elevated privilege.

What testing has been done?

Run integration tests

Test using a simple spec query example on local machine with SystemLink Client connected to a SLE instance with valid specs.

from nisystemlink.clients.spec import SpecClient
from nisystemlink.clients.spec.models import QuerySpecificationsRequest

client = SpecClient()

product_id = "e1ed79db-2d05-466b-a6d8-9872ec5cee54"
query_request = QuerySpecificationsRequest(product_ids=[product_id])

specs = client.query_specs(query_request)

print(specs.specs)
santhoshramaraj commented 2 months ago

@mure , Please review this simple bug fix PR.