gtalarico / pyairtable

Python Api Client for Airtable
https://pyairtable.readthedocs.io
MIT License
786 stars 139 forks source link

2.2 release missing table.update_field #325

Closed svonava closed 10 months ago

svonava commented 10 months ago

Hi all - thank you for the amazing work on pyairtable!

I noticed that in the roadmap* you mentioned that the release 2.2 contains table.update_field() but I can't see it in the code (checked both 2.2.0 and 2.2.1): https://github.com/gtalarico/pyairtable/blob/2.2.1/pyairtable/api/table.py

Probably just a typo in the milestone definition?

Thank you for the wonderful tool!

mesozoic commented 10 months ago

Yes, fair point, the roadmap document isn't necessarily getting updated with the details of API implementation, it's more of a todo list. In this case, modifying an existing field is done through the .save() method on the schema definition objects:

>>> schema = table.schema()
>>> schema.name = "Renamed Table"
>>> schema.save()
>>> field = schema.field("Name")
>>> field.name = "Label"
>>> field.description = "The primary field on the table"
>>> field.save()

You can read more about working with metadata here: https://pyairtable.readthedocs.io/en/stable/metadata.html#modifying-existing-schema