Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cty-ut
requested review from
JohnJyong,
QuantumGhost and
laipz8200
as code owners
October 16, 2026 10:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Fixes #<issue number>.Summary
Fixes #44217
Documents created after built-in metadata was enabled stored
upload_date/last_update_dateas"%Y-%m-%d %H:%M:%S"strings andsourceas the rawdata_source_type. Enabling built-in fields and batch metadata edits store epoch seconds and theMetadataDataSourcelabel instead. Time filters cast the value toFLOAT, so on PostgreSQL one mismatched document made the whole retrieval query fail.sourcefilters silently skipped those documents.Changes:
build_built_in_field_values()inmodels/dataset.py, next to theDocumentmodel that ownsdoc_metadata. All three writers now call it:SQLAlchemyMetadataRepository._built_inDocumentService.build_documentPipelineGenerator._build_documentlibs.datetime_utils.to_utc_timestamp. Behaviour is unchanged under the app (ext_timezoneforcesTZ=UTC), but the helper no longer depends on the process timezone, so it gives the same result in tests and scripts.models/and notservices/:pipeline_generatorlives incore, and adding a newcore -> servicesentry to the.importlinterbaseline would go against its "keep every exception exact" rule.Notes:
intinstead offloat. Filters cast toFLOAT, so filtering behaviour does not change.Testing
tests/unit_tests/services/knowledge/test_metadata_built_in_fields.py:TZsourcemapping for all six data source typesbuild_documentoutput matches the shared helpertest_build_document_sets_metadata_for_builtin_fieldsnow asserts the exact values instead of only checking thatdoc_metadatais truthy.ruff format/ruff checkon the changed files,lint-imports(68 kept, 0 broken),api-contract-lint, andpyreflyon the changed files all pass.Screenshots
N/A (backend only)
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint gods🤖 Generated with Claude Code
From Claude Code