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

[Bug] Incorrect types in cosmos_db_trigger decorator #1608

Open
syberen opened this issue Nov 11, 2024 · 3 comments · May be fixed by Azure/azure-functions-python-library#266
Open

[Bug] Incorrect types in cosmos_db_trigger decorator #1608

syberen opened this issue Nov 11, 2024 · 3 comments · May be fixed by Azure/azure-functions-python-library#266

Comments

@syberen
Copy link

syberen commented Nov 11, 2024

Expected Behavior

When using the start_from_time and start_from_beginning parameters, no typing errors should occur.

Actual Behavior

These fields (start_from_time and start_from_beginning ) are both typed as Optional[time]. It seems to me like it should be:

start_from_beginning: Optional[bool] = None,
start_from_time: Optional[str] = None, <-- is this str or datetime? It is unclear to me

Also, the fields are not correctly documented in microsoft learn:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2-trigger?tabs=python-v2%2Cisolated-process%2Cextensionv4%2Cnodejs-v4&pivots=programming-language-python#example

Steps to Reproduce

Go to this link and you will see the incorrect types

Relevant code being tried

Relevant log output

requirements.txt file

Where are you facing this problem?

Local - Core Tools

Function app name

No response

Additional Information

No response

@bhagyshricompany
Copy link

Hi @syberen Thanks for reporting lease share the repro steps.

@syberen
Copy link
Author

syberen commented Nov 18, 2024

@bhagyshricompany I've updated the issue with the place where you can find the issue

@hallvictoria
Copy link
Contributor

Hi @syberen, thanks for the catch. start_from_beginning should be bool, and start_from_time should be str. I've linked a PR with these changes. However, since we're currently in a release freeze with the holidays and this is a minor fix, release ETA is January.

The properties are mentioned in the documentation linked, but they're under the Configuration section. I agree though that the wording for the Decorators and Configuration sections is misleading. I'll work to get that updated, so that the V1 and V2 properties are accurately displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants