Skip to content

Fix f-string syntax error in microsoft-graph-security-intel breaking Python 3.11#6502

Closed
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-python-syntax-error-sentintel-graph
Closed

Fix f-string syntax error in microsoft-graph-security-intel breaking Python 3.11#6502
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-python-syntax-error-sentintel-graph

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

api_handler.py used double quotes inside double-quoted f-strings (PEP 701, Python 3.12+ only), causing a SyntaxError on Python 3.11 that prevented the connector from starting.

Change

Extract observable.get("value", None) to a local variable before the f-string, making the code valid on Python 3.11+:

# Before (Python 3.12+ only)
params = f"$filter=emailSenderAddress eq '{observable.get("value", None)}'"
params = f"$filter={ioc_type} eq '{observable.get("value", None)}'"

# After
observable_value = observable.get("value", None)
params = f"$filter=emailSenderAddress eq '{observable_value}'"
params = f"$filter={ioc_type} eq '{observable_value}'"

Affected method: SentinelApiHandler.search_indicators in stream/microsoft-graph-security-intel/src/microsoft_graph_security_intel_connector/api_handler.py.

Copilot AI changed the title [WIP] Fix Python f-string syntax error in Sentinel and Graph connectors Fix f-string syntax error in microsoft-graph-security-intel breaking Python 3.11 May 21, 2026
Copilot AI requested a review from SamuelHassine May 21, 2026 22:06
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

Successfully merging this pull request may close these issues.

Python error in Sentinel & Microsoft Graph connectors

2 participants