Querystring drops explicit empty-string scalar values
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Start at Querystring.stringify() and _stringify_item(), using the reproduction in the issue to trace how scalar values are serialized. Verify that None remains omitted while an explicit empty string produces filter=, including the array formats mentioned in the issue.
Written by the indexing model from the issue text.
Description
Querystring.stringify() drops an explicit empty-string scalar because _stringify_item() checks the serialized value with a truthiness test.
stringify({"filter": ""}) == "" # current behavior
This conflates an explicit empty value with None. In a URL query, filter= is distinct from omitting filter entirely. The behavior is also inconsistent across array formats, where an empty string can be retained by comma serialization.
Expected behavior: continue omitting None, but serialize an explicit empty string as filter=.
- Dominant language
- Python
- Stars
- 31.7k
- Forks
- 5.8k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 96
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/openai-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openai/openai-python#3755 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openai/openai-python#3556 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openai/openai-python#3402 · 2 comments ·
-
upstream
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openai/openai-python#3294 · 2 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openai/openai-python#2927 · 6 comments ·
All issues in openai/openai-python
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100