Do not show warnings when renaming api_names (#6424)

* warnings

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Abubakar Abid 2023-11-14 21:13:44 -08:00 committed by GitHub
parent 1959471a8d
commit 2727f45fb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": minor
---
feat:Do not show warnings when renaming api_names

View File

@ -925,7 +925,6 @@ class Blocks(BlockContext, BlocksEvents, metaclass=BlocksMeta):
api_name, [dep["api_name"] for dep in self.dependencies]
)
if api_name != api_name_:
warnings.warn(f"api_name {api_name} already exists, using {api_name_}")
api_name = api_name_
if collects_event_data is None:
@ -984,9 +983,6 @@ class Blocks(BlockContext, BlocksEvents, metaclass=BlocksMeta):
[dep["api_name"] for dep in Context.root_block.dependencies],
)
if api_name != api_name_:
warnings.warn(
f"api_name {api_name} already exists, using {api_name_}"
)
dependency["api_name"] = api_name_
dependency["cancels"] = [
c + dependency_offset for c in dependency["cancels"]