Skip to content

Commit

Permalink
Merge pull request #75 from gtalarico/remove-mirror-method
Browse files Browse the repository at this point in the history
Removes mirror method
  • Loading branch information
gtalarico committed Mar 15, 2020
2 parents c7a65b5 + df852a3 commit 3bded15
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 295 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.14.0
* Removed `mirror()` method.
*

# 0.13.0
* Fixed: Python 2 compatibility issues
* Start CI testing on all supported Python versions
Expand Down
32 changes: 0 additions & 32 deletions airtable/airtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,37 +548,5 @@ def batch_delete(self, record_ids):
"""
return self._batch_request(self.delete, record_ids)

def mirror(self, records, **options):
"""
Deletes all records on table or view and replaces with records.
>>> records = [{'Name': 'John'}, {'Name': 'Marc'}]
>>> record = airtable.,mirror(records)
If view options are provided, only records visible on that view will
be deleted.
>>> record = airtable.mirror(records, view='View')
([{'id': 'recwPQIfs4wKPyc9D', ... }], [{'deleted': True, ... }])
Args:
records(``list``): Records to insert
Keyword Args:
max_records (``int``, optional): The maximum total number of
records that will be returned. See :any:`MaxRecordsParam`
view (``str``, optional): The name or ID of a view.
See :any:`ViewParam`.
Returns:
records (``tuple``): (new_records, deleted_records)
"""

all_record_ids = [r["id"] for r in self.get_all(**options)]
deleted_records = self.batch_delete(all_record_ids)
new_records = self.batch_insert(records)
return (new_records, deleted_records)

def __repr__(self):
return "<Airtable table:{}>".format(self.table_name)
263 changes: 0 additions & 263 deletions tests/test_airtable.py.old

This file was deleted.

0 comments on commit 3bded15

Please sign in to comment.