Skip to content

Commit

Permalink
Fix duplicate()
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilman committed Jul 10, 2023
1 parent 2dcac93 commit c8be1b4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion gspread_asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1821,14 +1821,27 @@ async def duplicate(
:returns: a newly created :class:`AsyncioGspreadWorksheet`.
.. warning::
This breaks caching assumptions in AsyncioGspreadSpreadsheet.
Its use is not recommended and it will be removed in a future version.
.. versionadded:: 1.6
.. deprecated:: 1.9
Use `AsyncioGspreadSpreadsheet.duplicate_sheet` instead.
"""
return await self.agcm._call(
warnings.warn(
"duplicate() will be removed in a future version of gspread_asyncio, use duplicate_sheet()",
DeprecationWarning,
)
dup_ws = await self.agcm._call(
self.ws.duplicate,
insert_sheet_index=insert_sheet_index,
new_sheet_id=new_sheet_id,
new_sheet_name=new_sheet_name,
)
return AsyncioGspreadWorksheet(self.agcm, dup_ws)

async def find(
self,
Expand Down

0 comments on commit c8be1b4

Please sign in to comment.