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

table submit_transaction throws IndexError if there is no transaction #31471

Closed
G-M-twostay opened this issue Aug 4, 2023 · 3 comments · Fixed by #31482
Closed

table submit_transaction throws IndexError if there is no transaction #31471

G-M-twostay opened this issue Aug 4, 2023 · 3 comments · Fixed by #31482
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Release needed Tables

Comments

@G-M-twostay
Copy link

  • Package Name: azure-data-tables:
  • **Package Version: 12.4.3 **:
  • Operating System: win11 enterprise:
  • Python Version: 3.11:

Describe the bug
azure.data.tables.aio.TableClient.submit_transaction throws IndexError if the parameter operations is an empty list or empty iterator.

To Reproduce
Steps to reproduce the behavior:

  1. Setup an aio.TableClient. For example, client=TableClient(...).
  2. use client.submit_transaction([]).

Expected behavior
Since there is no transaction, I expected this to be a no-op and do nothing.

Screenshots
If applicable, add screenshots to help explain your problem.
Bug Traceback

Additional context
Add any other context about the problem here.

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables labels Aug 4, 2023
@kashifkhan
Copy link
Member

Thank you for the feedback @G-M-twostay . We will investigate and get back to you asap.

@kashifkhan kashifkhan removed the needs-team-triage This issue needs the team to triage. label Aug 4, 2023
@github-actions github-actions bot added the needs-team-attention This issue needs attention from Azure service team or SDK team label Aug 4, 2023
@YalinLi0312
Copy link
Member

Hi @G-M-twostay , thanks for reporting the issue! We are fixing it and will prepare a release with the bug fix soon.

@annatisch
Copy link
Member

annatisch commented Aug 24, 2023

Thanks @G-M-twostay - we have resolved the original deserialization error that was causing the IndexError - this will be released in the next azure-core release in September.
The reason for the IndexError is that the service actually treats this scenario as an error case and returns a 400 "InvalidInput" status code. The deserialization code in Core couldn't match the incoming error response to the outgoing request because the batch of requests was empty. Now that this has been fixed, the error response will be properly deserialized so the updated behaviour in this scenario will be an HttpResponseError rather than an IndexError (This behaviour will now be consistent across both Storage and Cosmos Tables services, as Cosmos was already raising an HttpResponseError in this scenario).

@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Release needed Tables
Projects
None yet
5 participants