Check Python client code base on using PLFM object model

Description

And ensure that adding a new field in any object model in PLFM should not break the Python client in the future.

Environment

None

Activity

Show:
Kimyen Truong
August 14, 2018, 11:14 PM

Checking the code and found questionable constructors for:

Though PartialRowSet and PartialRow constructor already diverted from theirs backend schema.

Notes: looking into every class implementation I found that only Activity implemented the idea that the constructor takes a dict object and initialize the object using the dict data, while other class implemented **kwagrs.

Kimyen Truong
August 15, 2018, 8:09 PM
Kimyen Truong
August 15, 2018, 10:27 PM

Discussed with Ziming about classes mentioned above:

  • PartialRowSet & PartialRow are constructors for the client users to use. We do not read data from the backend into these constructors.

  • Row is used to read backend data:

This indicates that the problem is in how we handle the dict object we get back from a http call rather than the constructor itself. Will look into all places we use **.

Kimyen Truong
August 15, 2018, 10:45 PM

I found many places where we used this pattern:
return [UserGroupHeader(**result) for result in self._GET_paginated(uri)]
However, all constructors that was used already accept **kwargs, so we should not have any problem there. The only places that need to be fixed are the places we used Row and SelectColumn with this pattern. I will fix these places.

Kimyen Truong
August 16, 2018, 12:31 AM

Assignee

Kimyen Truong

Reporter

Kimyen Truong

Labels

None

Validator

Ziming Dong

Development Area

None

Release Version History

None

Fix versions

Priority

Major
Configure