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

Python azure-search-backup-and-restore: appending the list failed_keys appears to fail #261

Open
marcindulak opened this issue Aug 2, 2024 · 0 comments

Comments

@marcindulak
Copy link

I'm not sure this is an artifact of my use of the notebook functions, or some type mismatch in the notebook implementation.

You can try to trigger the problem I'm describing by negating this condition

As a consequence, the azure-search-backup-and-restore notebook appears to fail on appending the list failed_keys, since page appears to be a list of dicts

    failed_keys.append(page[result.index_of(item)].id)  
                            ^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'index_of'

Trying to use the list.index fails on dict.id attribute access

    failed_keys.append(page[result.index(item)].id)  
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'id'

The following failed_keys.append(page[result.index(item)]["id"]) allows to advance further, but then fails at

    print(f"Document upload error: {item.error.message}")
                                    ^^^^^^^^^^
AttributeError: 'IndexingResult' object has no attribute 'error'

which should probably be print(f"Document upload error: {item.error_message}"), since item appears to be an instance of https://learn.microsoft.com/en-us/python/api/azure-search-documents/azure.search.documents.models.indexingresult

An extra question: are there any news about Azure AI Search getting a functionality of automatic index snapshots/backups and restores? The lack of this may create a friction in adoption of Azure AI search in enterprise setups.

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

No branches or pull requests

1 participant