fix: limpiar espacios en horas desde la fuente en _safe de Firebird
Usa strftime en vez de isoformat y aplica re.sub para eliminar espacios alrededor de los dos puntos en strings de tiempo de fdb. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
c5d6b9857e
commit
20a22e8e5b
@@ -9,16 +9,20 @@ def _safe(v):
|
||||
if v is None:
|
||||
return None
|
||||
if isinstance(v, datetime.datetime):
|
||||
return v.isoformat()
|
||||
return v.strftime("%Y-%m-%dT%H:%M:%S")
|
||||
if isinstance(v, datetime.date):
|
||||
return v.isoformat()
|
||||
if isinstance(v, datetime.time):
|
||||
return v.strftime("%H:%M:%S")
|
||||
if isinstance(v, decimal.Decimal):
|
||||
return float(v)
|
||||
if isinstance(v, (bytes, bytearray, memoryview)):
|
||||
return f"<BLOB {len(v)} bytes>"
|
||||
if isinstance(v, (int, float, str, bool)):
|
||||
if isinstance(v, (int, float, bool)):
|
||||
return v
|
||||
return str(v)
|
||||
# strings: strip any spaces around colons (Firebird sometimes returns "12: 47: 37")
|
||||
s = str(v)
|
||||
return re.sub(r'\s*:\s*', ':', s) if ':' in s else s
|
||||
|
||||
|
||||
class FirebirdService:
|
||||
|
||||
Reference in New Issue
Block a user