Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enforcing unique function names #216

Merged
merged 21 commits into from
Jul 22, 2024

Conversation

hallvictoria
Copy link
Contributor

@hallvictoria hallvictoria commented May 2, 2024

Currently, functions with the same function name can be created and deployed.
For example:

  • 2 or more functions with the same method name
@app.schedule(arg_name="name", schedule="10****")
def hello(name: str):
      return name

@app.schedule(arg_name="name", schedule="10****")
def hello(name: str):
      return name
  • 2 or more functions with the same function name 
@app.function_name("hello")
@app.schedule(arg_name="name", schedule="10****")
def function1(name: str):
      return name

@app.function_name("hello")
@app.schedule(arg_name="name", schedule="10****")
def function2(name: str):
      return name

This PR changes this so that the following scenarios are no longer supported. The same applies to blueprints (ie. function names must be distinct between all blueprints).

When creating an Asgi/Wsgi Function App, an integrated http function is automatically created and added. The function name here is hard-coded. In order to allow customization, the Asgi and Wsgi Function App constructors now also take in a function name. The default value is the previous value.

Fixes: Azure/azure-functions-python-worker#1489
Fixes: https://github.com/Azure/azure-functions-pyfx-planning/issues/313
Addresses ask in: Azure/azure-functions-python-worker#1422

@hallvictoria hallvictoria marked this pull request as ready for review May 29, 2024 19:51
@hallvictoria hallvictoria changed the title Enforcing unique function names fix: enforcing unique function names Jul 17, 2024
@hallvictoria hallvictoria merged commit b2e31ec into dev Jul 22, 2024
10 checks passed
@hallvictoria hallvictoria deleted the hallvictoria/unique-function-names branch July 22, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Worker indexing passes for duplicated function names
2 participants