Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions backend/python/app/sources/external/microsoft/one_note/one_note.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import json
import logging
from dataclasses import asdict
Expand Down Expand Up @@ -8098,34 +8096,31 @@ async def me_onenote_notebooks_delete_sections(
"""
# Build query parameters including OData for OneNote
try:
# Use typed query parameters
query_params = RequestConfiguration()
# Inline construction for performance/memory, avoid unnecessary assignments
config = RequestConfiguration()
query_params = config # set config and query_params as the same object

# Set query parameters using typed object properties
if select:
if select is not None:
query_params.select = select if isinstance(select, list) else [select]
if expand:
if expand is not None:
query_params.expand = expand if isinstance(expand, list) else [expand]
if filter:
if filter is not None:
query_params.filter = filter
if orderby:
if orderby is not None:
query_params.orderby = orderby
if search:
if search is not None:
query_params.search = search
if top is not None:
query_params.top = top
if skip is not None:
query_params.skip = skip

# Create proper typed request configuration
config = RequestConfiguration()
config.query_parameters = query_params

if headers:
if headers is not None:
config.headers = headers

# Add consistency level for search operations in OneNote
if search:
if not config.headers:
# Only set consistency if searching
if search is not None:
if not hasattr(config, "headers") or config.headers is None:
config.headers = {}
config.headers['ConsistencyLevel'] = 'eventual'

Expand Down