sassoftware / python-swat

The SAS Scripting Wrapper for Analytics Transfer (SWAT) package is the Python client to SAS Cloud Analytic Services (CAS). It allows users to execute CAS actions and process the results all from Python.
Other
147 stars 63 forks source link

Changing the name attribute of a CASTable object does not propagate to the actual CAS table #143

Open deboomce opened 1 year ago

deboomce commented 1 year ago

When changing the name attribute of a CASTable object, it does not propagate to the actual underlying CAS table. I have tried setting the name with setattr(), but this does not work.

I would be nice to have a method that can change the name of a CASTable.

pestyld commented 1 year ago

All CAS actions can be used as methods with the SWAT package.

To change the name of a CAS table you can use the table.alterTable CAS action.

So something like: conn = swat.CAS('connect to CAS information')

Reference your CAS table castbl = conn.CASTable('castablename', caslib = 'casuser')

Execute the alterTable action to change it's name castbl.alterTable(rename='newcastablename')

Here a blog post using alterTable to modify column names. You can use a version of the code above to change the table name as well.