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(providers/azure): remove json.dumps when querying AzureCosmosDBHook #33653

Conversation

Lee-W
Copy link
Member

@Lee-W Lee-W commented Aug 23, 2023

json.dumps leads to azure.cosmos.exceptions.CosmosHttpResponseError: (BadRequest) Message: {"Errors":["Invalid query. Specified parameterized query JSON is malformed."]}

https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/cosmos/azure-cosmos/samples/database_management.py#L41C36-L46


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@Lee-W Lee-W changed the title fix(providers/azure): remove json.dumps when querying cosmos fix(providers/azure): remove json.dumps when querying azure cosmos db hook Aug 23, 2023
@Lee-W Lee-W changed the title fix(providers/azure): remove json.dumps when querying azure cosmos db hook fix(providers/azure): remove json.dumps when querying AzureCosmosDBHook Aug 23, 2023
@uranusjr
Copy link
Member

The ignore comments you have to put in suggest something is wrong, but I’m not sure if it’s the code or the Azure lib.

@Lee-W
Copy link
Member Author

Lee-W commented Aug 23, 2023

The ignore comments you have to put in suggest something is wrong, but I’m not sure if it’s the code or the Azure lib.

I think it's the error from Azure lib. The annotation here and the code example here does not match

@Lee-W
Copy link
Member Author

Lee-W commented Aug 23, 2023

Where is the best place for me to put such comments? Around all the ignores?

@potiuk
Copy link
Member

potiuk commented Aug 24, 2023

The ignore comments you have to put in suggest something is wrong, but I’m not sure if it’s the code or the Azure lib.

I think it's the error from Azure lib. The annotation here and the code example here does not match

Looks like typing bug in azure. This LGTM.

@potiuk
Copy link
Member

potiuk commented Aug 24, 2023

Where is the best place for me to put such comments? Around all the ignores?

Maybe it woudl be worthwile to add a comment ("The ignores below is due to typing bug in azure lib x.y.z" . I also usually try to find if there is an issue open for that and if not i open it mysefl and post a link to the issue. This way anyone might check in the future if the issue has been solved and remove those unnecessary ignores when we upgrade.

@Lee-W Lee-W force-pushed the fix-CosmosClient-query_databases-json-parameter-failure branch from 3cdbd46 to 62c0bc6 Compare August 25, 2023 04:10
@Lee-W Lee-W requested a review from phanikumv August 25, 2023 07:37
json.dumps leads to "azure.cosmos.exceptions.CosmosHttpResponseError: (BadRequest) Message: {"Errors":["Invalid query. Specified parameterized query JSON is malformed."]}"
@Lee-W Lee-W force-pushed the fix-CosmosClient-query_databases-json-parameter-failure branch from 62c0bc6 to fe2567a Compare August 25, 2023 16:34
@Lee-W
Copy link
Member Author

Lee-W commented Aug 25, 2023

There was not. But I created one. Just added comments to the ignore

@potiuk potiuk merged commit 55ff4cf into apache:main Aug 25, 2023
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants