No error, but no change when using “Change Dataset Properties” API

I’m running into an issue running the “Change Dataset Properties” API, however. Running the code below should update the dataset name from “DataBricks Product Dataset” to “Databricks Testing”. I get a 200 status back and the response object returns the properties object as expected, but no change takes place either in the application or in the response object. With no error and a 200 response, I’m scratching my head on why nothing updates. I wanted to see if you maybe had any ideas on this. This is the first “PUT” method API call I’ve used with DOMO.
<code>
# Change dataset properties
importrequests
importos
importjson
token=os.environ.get('domo_access_token')
dataset='cc06eb69-e6ed-4ca2-9c42-a12a725368fe'
reqObj= {
"method": "PUT",
"url": "https://packsize.domo.com/api/data/v3/datasources/"+dataset+"/properties",
"headers": {
"X-DOMO-Developer-Token": token,
"Content-Type": "application/json"
},
"body": {
"name": "Databricks Testing
}
r=requests.put(reqObj.get("url"), headers=reqObj.get("headers"), json=reqObj.get("body"))
# Format Response
res=r.content
my_json=res.decode('utf8').replace("'", '"')
print(my_json)
data=json.loads(my_json)
s=json.dumps(data, indent=2, sort_keys=True)
print('-'*50)
print(s)
</code>
Answers
-
Since you're usign Python I'd recommend utilizing the pydomo package which has examples on how to rename datasets.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Welcome!
Welcome!
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 308 Workbench
- 6 Cloud Amplifier
- 10 Federated
- 3.8K Transform
- 660 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 815 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 84 App Studio
- 46 Variables
- 780 Automate
- 191 Apps
- 482 APIs & Domo Developer
- 84 Workflows
- 23 Code Engine
- 41 AI and Machine Learning
- 21 AI Chat
- 2 AI Projects and Models
- 18 Jupyter Workspaces
- 414 Distribute
- 122 Domo Everywhere
- 281 Scheduled Reports
- 11 Software Integrations
- 146 Manage
- 142 Governance & Security
- 8 Domo Community Gallery
- 49 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 4.8K Archive