Repository navigation
fix(ingestion): reliably parse epoch and ISO datetime bounds - #36169
Merged
Merged
Conversation
Contributor
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…ates in convert_timestamp
Contributor
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
TeddyCr
approved these changes
Nov 3, 2026
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.



Describe your changes:
Fix datetime test bounds that fail to parse or are scaled incorrectly because their string length includes a sign, leading zeroes, or fractional seconds. A bound such as
1675227600.125now remains epoch seconds instead of becoming1675227.600125.10^12seconds/milliseconds cutoff.python-dateutildependency, honoring timezone offsets and treating naive values as UTC across supported Python versions.preserve_datetime=True, preserving microseconds and handling multiple chunks/nulls. Default accumulators and metric output remain epoch milliseconds, including dimensional min/max validation; the between validator has no separate datetime aggregation loop.ValueError.Type of change:
High-level design:
The shared utility returns seconds since the Unix epoch. Numeric strings take precedence over compact ISO dates. Bare numeric values retain the historical seconds/milliseconds cutoff; explicit ISO strings avoid unit ambiguity. The contract and compatibility tradeoff are recorded in ADR:2026-11-03-timestamp-bounds-use-numeric-values-and-iso-dates.
Tests:
Use cases covered
Seconds/milliseconds, fractions, signs, leading zeroes, scientific notation, numeric compact-date ambiguity, ISO dates, space/T separators, Z/offsets, ordinal/week dates, UTC independence from local timezone, invalid/non-finite inputs, and SQL/pandas success/failure at datetime boundaries.
Unit tests
Current pandas refactor (
29e230a3b0e10e09950c18cbd4af3143f0f87136):pytest tests/unit/metadata/utils/test_time_utils.py tests/unit/test_time_utils.py tests/unit/observability/data_quality/validations/test_between_row_violations.py -q --tb=short— 138 passed.pytest tests/unit/observability/profiler/pandas/test_datalake_metrics.py -k 'extrema or test_min or test_max or test_time' -q --tb=short— 15 passed, 28 deselected. Covers ISO timezone offsets, microsecond preservation, multiple chunks/nulls, unchanged default milliseconds, numeric output, and configuration isolation.make py_format,make py_format_check,make static-checks, and commit hooks passed; type check reported 0 errors, 96 warnings.Earlier validation on
4d303c5faa8e874ecead164a2c6fdb9efd50bcd7(before the shared min/max refactor):convert_timestampand pandas_run_results: 100% line and branch coverage. Whole-module coverage is 77% and 83%, respectively.make static-checks: 0 errors, 94 existing warnings.make py_format,make py_format_check, lock validation, generated-model freshness, decision-record validation, and commit hooks passed.Backend integration tests
Not applicable — no Java/API/schema changes.
Ingestion integration tests
Real in-memory SQLite and pandas tests exercise the changed validator behavior without mocked metrics. External-service integration suites were not run; their time-utils imports use unchanged day-boundary helpers.
Playwright and UI screen recording
Not applicable — no UI changes.
Manual testing performed
Executed the parser under UTC, America/Los_Angeles, and Asia/Kolkata; validated the final committed diff against
REVIEW.mdwith a fresh independent review. Final independent review found no blocking issues at29e230a3b0e10e09950c18cbd4af3143f0f87136. The preceding review caught a dimensional min/max accumulator compatibility issue; the final commit fixes it and adds two regression tests.Checklist:
REVIEW.mdand independent review completed.Fixes COLLATE-INGESTION-Y3
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.


Confidence Score: 5/5
The PR appears safe to merge; both previous findings are addressed.Summary
convert_timestamp()accepts ISO datetime strings while keeping numeric timestamp parsing.Reviews (2) · Last reviewed commit: "fix(ingestion): prevent numeric timestam..." · Reviewed by Greptile