{"record":{"id":"96f7c39a4ec67ffe","repo":"nautechsystems/nautilus_trader","slug":"gamma-scope-filter-key-values-must-be-unsign","errorCode":null,"errorMessage":"Gamma {scope} filter '{key}' values must be unsigned integers: {e}","messagePattern":"Gamma (.+?) filter '(.+?)' values must be unsigned integers: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/providers.rs","lineNumber":1018,"sourceCode":"        .map(str::to_string)\n        .collect::<Vec<_>>();\n\n    if values.is_empty() || values.iter().any(String::is_empty) {\n        anyhow::bail!(\"Gamma {scope} filter '{key}' must contain non-empty comma-separated values\")\n    }\n    Ok(values)\n}\n\nfn parse_gamma_numeric_filter_list(\n    scope: &str,\n    key: &str,\n    value: &str,\n) -> anyhow::Result<Vec<u64>> {\n    parse_gamma_filter_list(scope, key, value)?\n        .into_iter()\n        .map(|item| {\n            item.parse::<u64>().map_err(|e| {\n                anyhow::anyhow!(\n                    \"Gamma {scope} filter '{key}' values must be unsigned integers: {e}\"\n                )\n            })\n        })\n        .collect()\n}\n\nfn parse_gamma_filter_string(scope: &str, key: &str, value: &str) -> anyhow::Result<String> {\n    if value.trim().is_empty() {\n        anyhow::bail!(\"Gamma {scope} filter '{key}' cannot be empty\")\n    }\n    Ok(value.to_string())\n}\n\n/// Resolves a tag slug to a tag ID by querying the Gamma tags endpoint.\npub async fn resolve_tag_slug(\n    client: &PolymarketGammaHttpClient,\n    slug: &str,","sourceCodeStart":1000,"sourceCodeEnd":1036,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/providers.rs#L1000-L1036","documentation":"parse_gamma_numeric_filter_list first splits a comma-separated Gamma filter into a list (parse_gamma_filter_list) then parses each element as u64. If any individual element fails u64 parsing, the whole filter fails with 'Gamma {scope} filter {key} values must be unsigned integers'.","triggerScenarios":"Passing a comma-separated list filter where at least one element is not a plain non-negative integer, e.g. \"123, abc\" or \"1, 2.5, 3\".","commonSituations":"Lists built by joining IDs with names, trailing commas producing empty elements, or list values accidentally nested/quoted in config.","solutions":["Ensure every comma-separated element is a bare non-negative integer, e.g. \"1,2,3\"","Remove empty segments caused by trailing commas; trim whitespace around each item (the parser trims only after splitting)","Validate the list in the caller with a parse::<u64> check before building params","If a mixed-type list is needed, use the non-numeric list filter variant instead"],"exampleFix":"// before\nfilters.insert(\"tag_ids\", \"12, 34,\");\n// after\nfilters.insert(\"tag_ids\", \"12,34\");","handlingStrategy":"validation","validationCode":"// Rust\nfn is_u64_list(v: &str) -> bool {\n    v.split(',').map(str::trim).all(|s| s.parse::<u64>().is_ok())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Join list filters from typed numeric collections, not hand-written strings","Avoid trailing commas in list config values","Validate each element with parse::<u64> at config load time"],"tags":["validation","parsing","list","integer","polymarket"],"backgroundTag":"invalid-argument-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}