intelligence-layer-sdk
intelligence-layer-sdk copied to clipboard
fix: URL-encode document names in document index client requests
Description
Prior to this commit, we did not URL-encode document names when querying the document index. This caused problems when names have special characters, i.e., '/' or '?'. We do not need to URL-encode other parts of the URL (e.g., namespace or collection) as these are already constrained to URL-safe characters. In addition to this fix, this commit includes the following changes:
- update
DocumentPath.from_slash_separated_str
to correctly delimit paths whose document name contains a forward slash. Ideally we'd remove both this andDocumentPath.to_slash_separated_str
in the future. - parametrize tests to include special characters and increase coverage
- migrate to new document index collection to avoid CI conflicts
Before Merging
- [ ] Review the code changes
- Unused print / comments / TODOs
- Missing docstrings for functions that should have them
- Consistent variable names
- ...
- [x] Update
changelog.md
if necessary - [ ] Commit messages should contain a semantic label and the ticket number
- Consider squashing if this is not the case