thoughtspot / thoughtspot_rest_api_v1_python

Python implementations of ThoughtSpot REST APIs V1 and V2
Other
3 stars 6 forks source link

metadata_details is missing last position from the json data #11

Closed boonhapus closed 1 year ago

boonhapus commented 1 year ago

The metadata/details API end from tsrestapiv1 it's leaving the last position from the data which is nothing but the last column is dropped out while using this. For example if there are 81 positions in the json data from swagger for a particular guid_id, when this API end is used in code there are only 80 positions .

details = ts.metadata_details(object_type='LOGICAL_TABLE', object_guids=[""])
print(details)

The code which supports this simply passes through the response data, so this is likely not an issue in this library. What field are you expecting to see in the details response that you're not?

Relevant method call here https://github.com/thoughtspot/thoughtspot_rest_api_v1_python/blob/82a81bd43623717c5ae1f889521fb9eae40e6adc/src/thoughtspot_rest_api_v1/tsrestapiv1.py#L674-L695

venkataswetha1997 commented 1 year ago

After the thoughtspot upgrade to Version: 8.8.1.sw.cu1 , there are few data columns that are not generating a response. I checked with this on swagger end and there is no issue like missing the last position. But when I tried to replicate the same using the code, it's just not bringing the last position. So to make sure of this, I tried to check the same with the other worksheets and they don't have any problem until and unless it's a data column. Do you think this is related to the data issue?

Screenshot 2023-08-02 at 1 57 52 PM
boonhapus commented 1 year ago

When you say "data column" , what do you mean?

If the object is corrupt, then metadata/details would also show similar missing information. We'd have to open a support ticket to investigate why and potentially resolve.

bryanthowell-ts commented 1 year ago

^ As mentioned above, this method does no additional processing on the response, it simply returns what was received from the GET request:

url = self.base_url + endpoint response = self.requests_session.get(url=url, params=url_params) response.raise_for_status() return response.json()

Have you put both outputs into something capable of a diff operation (https://www.diffchecker.com/ may not handle such a large response, but could be a start)?

It's also possible that the formatting is just slightly different. I typically use to get the most readable output of JSON: print(json.dumps(json_obj, indent=2))

venkataswetha1997 commented 1 year ago

I think I figured the issue, it is irrespective of the position. The last position is missing out because it is a hidden column. The columns that are missing on the metadata/details api end are the hidden columns. The default was set to false for show hidden. I changed that and everything works like a charm. Thank you so much for your time and suggestion.