René's URL Explorer Experiment


Title: Adding request info does not use specified request_id for BatchRequestContent · Issue #810 · microsoftgraph/msgraph-sdk-python-core · GitHub

Open Graph Title: Adding request info does not use specified request_id for BatchRequestContent · Issue #810 · microsoftgraph/msgraph-sdk-python-core

X Title: Adding request info does not use specified request_id for BatchRequestContent · Issue #810 · microsoftgraph/msgraph-sdk-python-core

Description: Describe the bug Trying to add batch request steps with custom request IDs so that I can track the responses, however the custom request ID is always overridden to a random uuid Expected behavior Should be able to specify a custom reques...

Open Graph Description: Describe the bug Trying to add batch request steps with custom request IDs so that I can track the responses, however the custom request ID is always overridden to a random uuid Expected behavior S...

X Description: Describe the bug Trying to add batch request steps with custom request IDs so that I can track the responses, however the custom request ID is always overridden to a random uuid Expected behavior S...

Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Adding request info does not use specified request_id for BatchRequestContent","articleBody":"### Describe the bug\n\nTrying to add batch request steps with custom request IDs so that I can track the responses, however the custom request ID is always overridden to a random uuid\n\n### Expected behavior\n\nShould be able to specify a custom request ID as specified in the function doc strings and in samples.\n\n### How to reproduce\n\nYou can track this through:\n\nmsgraph_core/requests/batch_request_content.py\n\n```python\n    def add_request_information(\n        self, request_information: RequestInformation, request_id: Optional[str] = None\n    ) -\u003e None:\n        \"\"\"\n        Adds a request to the batch request content.\n        Args:\n            request_information (RequestInformation): The request information to add.\n            request_id: Optional[str]: The request id to add.\n        \"\"\"\n        request_id = request_id if request_id else str(uuid.uuid4())\n        self.add_request(request_id, BatchRequestItem(request_information))\n```\n\nWhen creating the BatchRequestItem (msgraph_core/requests/batch_request_item.py), we've not passed the request ID into the init, so a random one is assigned to the Item:\n\n```python\n    def __init__(\n        self,\n        request_information: Optional[RequestInformation] = None,\n        id: str = \"\",\n        depends_on: Optional[list[Union[str, 'BatchRequestItem']]] = []\n    ):\n        \"\"\"\n        Initializes a new instance of the BatchRequestItem class.\n        Args:\n            request_information (RequestInformation): The request information.\n            id (str, optional): The ID of the request item. Defaults to \"\".\n            depends_on (Optional[list[Union[str, BatchRequestItem]], optional):\n            The IDs of the requests that this request depends on. Defaults to None.\n        \"\"\"\n        if request_information is None or not request_information.http_method:\n            raise ValueError(\"HTTP method cannot be Null/Empty\")\n        self._id = id or str(uuid4())\n```\n\nThe custom one is then only used if there isn't one already on the request, which is impossible here because of the initialisation of the item object:\n\n```python\n    def add_request(self, request_id: Optional[str], request: BatchRequestItem) -\u003e None:\n        \"\"\"\n        Adds a request to the batch request content.\n        Args:\n            request_id (Optional[str]): The request id to add.\n            request (BatchRequestItem): The request to add.\n        \"\"\"\n        if len(self.requests) \u003e= BatchRequestContent.MAX_REQUESTS:\n            raise RuntimeError(f\"Maximum number of requests is {BatchRequestContent.MAX_REQUESTS}\")\n        if not request.id:\n            request.id = request_id if request_id else str(uuid.uuid4())\n```\n\nSo it's impossible for you to set a custom request ID through the `add_request_information` function. Either we should pass the custom one into the initialisation of the Item, or the \"add_request\" function should be checking for whether we have a `request_id` not a `request.id`. Suspect it should be the latter otherwise the function signature makes no sense.\n\n\n### SDK Version\n\n1.17.0 of the SDK, 1.20.0 of msgraph-core\n\n### Latest version known to work for scenario above?\n\n_No response_\n\n### Known Workarounds\n\n_No response_\n\n### Debug output\n\n\u003cdetails\u003e\u003csummary\u003eClick to expand log\u003c/summary\u003e\n```\n\n\u003cLog output here\u003e\n\n```\n\u003c/details\u003e\n\n\n### Configuration\n\n_No response_\n\n### Other information\n\n_No response_","author":{"url":"https://github.com/drhar","@type":"Person","name":"drhar"},"datePublished":"2025-01-23T10:39:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/810/msgraph-sdk-python-core/issues/810"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4e097687-af90-8921-c473-bd82c8b1fe25
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA054:245D90:B7EAE:F44D6:6969D2A4
html-safe-nonce7a8dfdfd9508b946b6062a0d8ff4a61bd9f41c7243a390bcde5bc01894c557bd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDU0OjI0NUQ5MDpCN0VBRTpGNDRENjo2OTY5RDJBNCIsInZpc2l0b3JfaWQiOiIxMjUwOTIyMTQ1OTkwMTY5MjUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac284f0688644d9ee6d260ff7b5def9d7c9bdcfbcac12e227cb72c01f392da90c3
hovercard-subject-tagissue:2806543599
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-python-core/810/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e67694c67011915284d5fd862bc74a133572b6f231f48401baa4b1b6e92d71c2/microsoftgraph/msgraph-sdk-python-core/issues/810
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e67694c67011915284d5fd862bc74a133572b6f231f48401baa4b1b6e92d71c2/microsoftgraph/msgraph-sdk-python-core/issues/810
og:image:altDescribe the bug Trying to add batch request steps with custom request IDs so that I can track the responses, however the custom request ID is always overridden to a random uuid Expected behavior S...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedrhar
hostnamegithub.com
expected-hostnamegithub.com
Noneacedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056
turbo-cache-controlno-preview
go-importgithub.com/microsoftgraph/msgraph-sdk-python-core git https://github.com/microsoftgraph/msgraph-sdk-python-core.git
octolytics-dimension-user_id17304259
octolytics-dimension-user_loginmicrosoftgraph
octolytics-dimension-repository_id242847794
octolytics-dimension-repository_nwomicrosoftgraph/msgraph-sdk-python-core
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id242847794
octolytics-dimension-repository_network_root_nwomicrosoftgraph/msgraph-sdk-python-core
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release83c08c21cdda978090dc44364b71aa5bc6dcea79
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-python-core%2Fissues%2F810
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-python-core%2Fissues%2F810
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoftgraph%2Fmsgraph-sdk-python-core
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810
microsoftgraph https://github.com/microsoftgraph
msgraph-sdk-python-corehttps://github.com/microsoftgraph/msgraph-sdk-python-core
Notifications https://github.com/login?return_to=%2Fmicrosoftgraph%2Fmsgraph-sdk-python-core
Fork 45 https://github.com/login?return_to=%2Fmicrosoftgraph%2Fmsgraph-sdk-python-core
Star 277 https://github.com/login?return_to=%2Fmicrosoftgraph%2Fmsgraph-sdk-python-core
Code https://github.com/microsoftgraph/msgraph-sdk-python-core
Issues 15 https://github.com/microsoftgraph/msgraph-sdk-python-core/issues
Pull requests 16 https://github.com/microsoftgraph/msgraph-sdk-python-core/pulls
Discussions https://github.com/microsoftgraph/msgraph-sdk-python-core/discussions
Actions https://github.com/microsoftgraph/msgraph-sdk-python-core/actions
Projects 0 https://github.com/microsoftgraph/msgraph-sdk-python-core/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/microsoftgraph/msgraph-sdk-python-core/security
Please reload this pagehttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810
Insights https://github.com/microsoftgraph/msgraph-sdk-python-core/pulse
Code https://github.com/microsoftgraph/msgraph-sdk-python-core
Issues https://github.com/microsoftgraph/msgraph-sdk-python-core/issues
Pull requests https://github.com/microsoftgraph/msgraph-sdk-python-core/pulls
Discussions https://github.com/microsoftgraph/msgraph-sdk-python-core/discussions
Actions https://github.com/microsoftgraph/msgraph-sdk-python-core/actions
Projects https://github.com/microsoftgraph/msgraph-sdk-python-core/projects
Security https://github.com/microsoftgraph/msgraph-sdk-python-core/security
Insights https://github.com/microsoftgraph/msgraph-sdk-python-core/pulse
New issuehttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810
New issuehttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810
Adding request info does not use specified request_id for BatchRequestContenthttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810#top
P1Priorityhttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues?q=state%3Aopen%20label%3A%22P1%22
priority:p1High priority/Major issue but not blocking or Big percentage of customers affected.Bug SLA <=7dayshttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues?q=state%3Aopen%20label%3A%22priority%3Ap1%22
type:bugA broken experiencehttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues?q=state%3Aopen%20label%3A%22type%3Abug%22
https://github.com/drhar
https://github.com/drhar
drharhttps://github.com/drhar
on Jan 23, 2025https://github.com/microsoftgraph/msgraph-sdk-python-core/issues/810#issue-2806543599
P1Priorityhttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues?q=state%3Aopen%20label%3A%22P1%22
priority:p1High priority/Major issue but not blocking or Big percentage of customers affected.Bug SLA <=7dayshttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues?q=state%3Aopen%20label%3A%22priority%3Ap1%22
type:bugA broken experiencehttps://github.com/microsoftgraph/msgraph-sdk-python-core/issues?q=state%3Aopen%20label%3A%22type%3Abug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.