- Open
- Fixed
- The
_postretry loop uses synchronoustime.sleep(delay)inside an async function, blocking the entire event loop. - Fix: Replace with
await asyncio.sleep(delay).
- Condition
if not value.endswith('Z') and value[10] == 'T'is inverted. Also,value[10]raises IndexError for short strings. - Fix: Change to
if len(value) < 20 or not value.endswith('Z') or value[10] != 'T'.
-
params['hl_fl'] = [fields]wraps a string in a list. Solr expects a string. - Fix: Change to
params['hl_fl'] = fields.
- If
probe.ping()raises an exception,probe.close()is never called. - Fix: Use
try/finallyto ensureprobe.close()is always called.
-
int(self.results.start)raises TypeError (not AttributeError) when start is None. - Fix: Catch
(AttributeError, TypeError).
-
other._args.insert(0, self)permanently modifiesother, causing bugs on reuse. - Fix: Create a copy of
otherbefore inserting.
-
(ssl_cert, ssl_key)becomes(None, ssl_key)when only ssl_key is given. - Fix: Validate that ssl_cert is provided when ssl_key is given.
- The
nameparameter is accepted but never included in the output dict. - Fix: Accept both legacy
(name, q)and new(q)call forms.
-
timeoutis included in the urlencode'd query string before being popped, sending an unwantedtimeoutparameter to Solr. - Fix: Pop timeout from params before urlencode.
-
super().add(docs)goes through@committingdecorator which already commits. ThenPysolrCompat.add()callsself.commit()again. - Fix: Pass
commit=committo super calls, remove separate commit call.
-
query_paramsalready contains'wt': 'json', andDualTransport.get_json()appendswt=jsonagain. - Fix: Remove
'wt': 'json'fromquery_params.
-
close()creates a newhttpx.Clientjust to close it if never used. - Fix: Won't fix — kept for
is_closedconsistency required by existing tests and API contract.
- Field names like
"classic"matchendswith("asc"), skipping sort direction. - Fix: Check
endswith(" asc")orendswith(" desc")with space prefix.
-
import urllib.parse as urlparseandimport urllib.parse as urllibimport the same module twice. - Fix: Remove the duplicate and unify to one alias.
-
self.query(**new_params)passesqinside**new_paramsas a keyword, butSearchHandler.__call__hasqas a positional arg. Ifqis missing from params, query is None. - Fix: Pop
qfrom new_params and pass it as first positional arg.
-
self.header.get('rows', ...)looks at top-level header, butrowsis nested underheader['params']. - Fix: Use
self.header.get('params', self.header).get('rows', ...).
-
for id in ids:shadows both the function parameter and the builtinid(). - Fix: Rename loop variable to
doc_id.
-
build_hybrid_queryusesv="[...]"inside local params, whilebuild_similarity_queryputs the vector in the query body. Inconsistent API and may fail on some Solr versions. - Fix: Use the body-style format consistent with
build_similarity_query.