fix: _decay_edges — handle string updated_at from Qdrant and add TableShim delete/update
The Qdrant _TableShim returned updated_at as ISO strings (not datetime objects), causing str.replace(tzinfo=...) to fail with "str.replace() takes no keyword arguments". Parse strings via datetime.fromisoformat() before timezone handling. Also add missing delete(where) and update(where=, values=) methods to _TableShim so the LanceDB-compatible shim works with Qdrant's payload collection, plus a _parse_where() helper to convert where clauses to Qdrant Filters.
This commit is contained in:
parent
6bd479b137
commit
7eea3ced28
2 changed files with 137 additions and 4 deletions
|
|
@ -185,10 +185,13 @@ def _decay_edges(
|
|||
last = row["updated_at"]
|
||||
if last is None:
|
||||
continue
|
||||
# Coerce naive -> UTC; pandas may drop tz on some backends.
|
||||
try:
|
||||
py = last.to_pydatetime() if hasattr(last, "to_pydatetime") else last
|
||||
except Exception:
|
||||
# Coerce to datetime: pandas Timestamp -> pydatetime, ISO string -> datetime,
|
||||
# or already a datetime object.
|
||||
if hasattr(last, "to_pydatetime"):
|
||||
py = last.to_pydatetime()
|
||||
elif isinstance(last, str):
|
||||
py = datetime.fromisoformat(last)
|
||||
else:
|
||||
py = last
|
||||
if getattr(py, "tzinfo", None) is None:
|
||||
py = py.replace(tzinfo=timezone.utc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue