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

SyntaxWarning: invalid escape sequence '\W' #38562

Closed
Goldziher opened this issue Nov 15, 2024 · 7 comments
Closed

SyntaxWarning: invalid escape sequence '\W' #38562

Goldziher opened this issue Nov 15, 2024 · 7 comments
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. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search

Comments

@Goldziher
Copy link

  • Package Name: azure-search-documents
  • Package Version: 11.5.2
  • Operating System: MacOS
  • Python Version: 3.12.7

Describe the bug
The following is thrown when loading the library with Python 3.12:

azure/search/documents/indexes/_generated/models/_models_py3.py:5644: SyntaxWarning: invalid escape sequence '\W'
pattern: str = "\W+",
azure/search/documents/indexes/_generated/models/_models_py3.py:5869: SyntaxWarning: invalid escape sequence '\W'
pattern: str = "\W+",

To Reproduce
Load ai search in python 3.12. This issue is also reported by mypy.

@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-attention Workflow: This issue needs attention from Azure service team or SDK team labels Nov 15, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@github-actions github-actions bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search labels Nov 15, 2024
@xiangyan99
Copy link
Member

@xiangyan99 xiangyan99 added the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Nov 15, 2024
Copy link

Hi @Goldziher. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 15, 2024
@Goldziher
Copy link
Author

Good to know this isnt a dangerous bug. Its still pretty annoying though - I am also getting warning when just running CLI commands, example:

➜  temp git:(main) az login
/opt/homebrew/Cellar/azure-cli/2.66.0/libexec/lib/python3.12/site-packages/azure/batch/models/_models_py3.py:4839: SyntaxWarning: invalid escape sequence '\s'
  """A Job Preparation Task to run before any Tasks of the Job on any given
A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.

Copy link

Hi @Goldziher, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

@ashb
Copy link

ashb commented Jan 29, 2025

This model being private doesn't mean the file isn't imported.

Running this on Python 3.12+ leads to loads of warnings like this. (Synapse is the worse offender with 311 warnings!)

@pamelafox
Copy link
Member

I'm getting this as well, but I'm assuming I'm behind a version, as the offending line does have a r in the main branch:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search
Projects
None yet
Development

No branches or pull requests

4 participants