Skip to content

Conversation

iceljc
Copy link
Collaborator

@iceljc iceljc commented Aug 25, 2025

PR Type

Bug fix


Description

  • Fix datetime conversion in Qdrant vector database operations

  • Replace ToString() with ConvertToString() for data value conversion

  • Remove unnecessary UTC conversion for datetime payload formatting


Diagram Walkthrough

flowchart LR
  A["Data Value"] --> B["ConvertToString()"]
  B --> C["DateTime Parsing"]
  C --> D["ISO Format Output"]
Loading

File Walkthrough

Relevant files
Bug fix
QdrantDb.cs
Fix datetime conversion methods                                                   

src/Plugins/BotSharp.Plugin.Qdrant/QdrantDb.cs

  • Replace ToString() with ConvertToString() for payload data value
    conversion
  • Remove ToUniversalTime() call from datetime formatting, keeping only
    ISO format
+2/-2     

@iceljc iceljc merged commit 222e4f7 into SciSharp:master Aug 25, 2025
0 of 4 checks passed
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Timezone Handling

Removing UTC normalization may store local times and lead to inconsistent querying or sorting across systems. Confirm Qdrant expects UTC or timezone-aware ISO strings and ensure inputs include offsets where applicable.

    break;
case VectorPayloadDataType.Integer when long.TryParse(value, out var longVal):
    point.Payload[item.Key] = longVal;
    break;
case VectorPayloadDataType.Double when double.TryParse(value, out var doubleVal):
    point.Payload[item.Key] = doubleVal;
    break;
case VectorPayloadDataType.Datetime when DateTime.TryParse(value, out var dt):
    point.Payload[item.Key] = dt.ToString("o");
    break;
Parsing Culture

Using DateTime.TryParse without explicit culture or styles can behave differently by locale. Consider invariant culture and round-trip styles to avoid misparsing.

    break;
case VectorPayloadDataType.Integer when long.TryParse(value, out var longVal):
    point.Payload[item.Key] = longVal;
    break;
case VectorPayloadDataType.Double when double.TryParse(value, out var doubleVal):
    point.Payload[item.Key] = doubleVal;
    break;
case VectorPayloadDataType.Datetime when DateTime.TryParse(value, out var dt):
    point.Payload[item.Key] = dt.ToString("o");
    break;
Conversion Consistency

Switching to ConvertToString() changes serialization semantics; ensure it matches expected formats for numeric and datetime types and does not introduce trimming or null-to-empty conversions that affect downstream logic.

foreach (var item in payload)
{
    var value = item.Value.DataValue?.ConvertToString();
    if (value == null || item.Key.IsEqualTo(KnowledgePayloadName.Text))
    {
        continue;
    }

Copy link

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant