Repository navigation
Pass documented query string keywords through in ten service class methods - #1532
Open
ajaykr0905 wants to merge 1 commit into
Open
ajaykr0905 wants to merge 1 commit into
ajaykr0905 wants to merge 1 commit into
Conversation
ajaykr0905
requested review from
alhumaw,
crowdstrikedcs and
jshcodes
as code owners
November 15, 2026 06:40
Ten service class methods documented query string keywords that never reached the URL. Eight of them called process_service_request without keywords=kwargs, so the values were dropped: RealTimeResponse.init_session (timeout, timeout_duration) Hosts.query_device_login_history_v2 (limit, from, to) NGSIEM.update_data_connection (ids) FirewallManagement.update_network_locations_metadata (comment) FirewallManagement.update_network_locations_precedence (comment) FalconXSandbox.submit (aid) Agents.create_or_update_agent (wait_for_ready) AgentInvocation.update_agent_invocation (project_id) FirewallManagement.upsert_network_locations (comment) and CustomStorage.upload_version (dry_run) passed keywords but no params dict, so args_to_params raised and the call returned "Keyword arguments are required to use this method." without sending anything. All ten now pass keywords=kwargs and params=parameters. The five methods without a parameters argument (init_session, create_or_update_agent, update_agent_invocation, upsert_network_locations, upload_version) get one in @force_default, the signature, the docstring and the .pyi stub. Request bodies are unchanged. Adds offline unit tests that check the query string and body each method hands to requests.
ajaykr0905
force-pushed
the
fix/1529-pass-query-keywords
branch
from
November 15, 2026 17:24
d39e11e to
934285c
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pass documented query string keywords through
Ten service class methods document query string keywords that never reached the URL.
Eight of them called
process_service_requestwithoutkeywords=kwargs, so the values were dropped without a warning:RealTimeResponse.init_session(timeout,timeout_duration),Hosts.query_device_login_history_v2(limit,from,to),NGSIEM.update_data_connection(ids),FirewallManagement.update_network_locations_metadataandupdate_network_locations_precedence(comment),FalconXSandbox.submit(aid),Agents.create_or_update_agent(wait_for_ready) andAgentInvocation.update_agent_invocation(project_id).The other two,
FirewallManagement.upsert_network_locations(comment) andCustomStorage.upload_version(dry_run), passed keywords but noparamsdict.args_to_paramsthen raised, and the call returned "Keyword arguments are required to use this method." without sending anything.I changed all ten to pass
keywords=kwargsandparams=parameters, following sibling methods such asupdate_network_locationsandCustomStorage.upload. The five methods that had noparametersargument (init_session,create_or_update_agent,update_agent_invocation,upsert_network_locations,upload_version) now take one, added to@force_default, the signature, the docstring and the.pyistub. Request bodies are unchanged, and this is not a breaking change:bodyis still the first positional argument and the new argument is keyword-optional.Unit test coverage
I added
tests/test_query_string_keywords.py. For each method it patchesrequests.requestand checks the query string and body the SDK hands to it, both for keywords and for an explicitparameters={...}dict. No network access or credentials are needed. All 21 tests pass; before the change, 15 of them failed. Every changed line is covered by these tests, and the existing mocked suitestest_ssl_verify.pyandtest_non_json_error_responses.pystill pass. I couldn't run the fullutil/run-tests.shcoverage report because it needs API credentials.Bandit analysis
bandit -r src: No issues identified.flake8, pylint (
--max-line-length=127 --disable=R0801) and pydocstyle are clean on the changed files.Issues resolved
parametersargument where it was missing.Other
The issue also mentions
CloudAzureRegistration.health_check,FalconContainer.update_registry_entitiesand two misspelled docstring keywords in the network location metadata and precedence methods. I left those out to keep this PR focused and can follow up separately. I didn't test against a live tenant. The tests check the request the SDK builds.