thoughtspot / cs_tools

Scale your ThoughtSpot adoption with tools created by the ThoughtSpot Solutions Consulting organization.
https://thoughtspot.github.io/cs_tools/
Other
8 stars 6 forks source link

Unable to share table via cs_tools #42

Closed jhughes-naic closed 1 year ago

jhughes-naic commented 1 year ago

First Stop

Description

First time using cs_tools so I'm not sure if this is a user error or something with cs_tools. I'm trying to share a table with a group and am receiving the following error>

File "/Users/jhughes/Library/Application Support/cs_tools/.cs_tools/lib/python3.10/site-packages/cs_tools/cli/tools/security-sharing/app.py", line 196, in share                                               
               table_ids = _get_table_ids(ts.api, db=database, schema=schema, table=table)                                                                                                                                  
             File "/Users/jhughes/Library/Application Support/cs_tools/.cs_tools/lib/python3.10/site-packages/cs_tools/cli/tools/security-sharing/app.py", line 77, in _get_table_ids                                       
               r = api._metadata.list(type='LOGICAL_TABLE', subtype=['ONE_TO_ONE_LOGICAL'])                                                                                                                                 
             File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function                                                                                                      
             File "pydantic/decorator.py", line 133, in pydantic.decorator.ValidatedFunction.call                                                                                                                           
             File "pydantic/decorator.py", line 130, in pydantic.decorator.ValidatedFunction.init_model_instance                                                                                                            
             File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__                                                                                                                                         
           pydantic.error_wrappers.ValidationError: 1 validation error for List                                                                                                                                             
           kwargs                                                                                                                                                                                                           
             unexpected keyword argument: 'subtype' (type=type_error)       

From what I can tell my values passed in the CLI is corrects as I copied them from the TML on the table. cs_tools tools security-sharing share --group AZ_TS_FINREG_PUBLIC_PROD --permission view --database NAIC_PROD_FINANCIAL --schema BI_FRA_THOUGHTSPOT --table XXPSSCPPT2 --config prod

Running cs_tools 1.3.4 from a M1 Mac

boonhapus commented 1 year ago

Hi @jhughes-naic , welcome to the project! 👋

Thanks for finding this one.. I can already see the issue. This is definitely an error on our side. There's a typo in the command. It should be subtypes instead of subtype (no s). I'll fix this in our upcoming release.

https://github.com/thoughtspot/cs_tools/blob/39f776848ab0d515f48709ba29b9d624beac5293/cs_tools/api/models/metadata.py#L103

jhughes-naic commented 1 year ago

Awesome. Thanks! I'm new here. How often do releases occur?

boonhapus commented 1 year ago

@jhughes-naic , we don't have a release cadence. There's a few of us that contribute code and SpotApps on the ThoughtSpot side. I'm planning on releasing a new version over the next couple weeks! You can find the cool stuff in #39 . Typically after a major release, we'll do a few minor releases soon after to help clean up bugs or blockers that customers run into.

If we hadn't planned on releasing a new version in the coming weeks, we'd absolutely push a bugfix for this kind of thing within a couple of days.

boonhapus commented 1 year ago

This is resolved as part of V1.4.0 . Check the release notes to learn more.

https://thoughtspot.github.io/cs_tools/changelog/1.4.0