Skip to content

fix(ingestion): support ISO datetime strings in convert_timestamp for test bounds - #36144

Merged
Khairajani merged 2 commits into
mainfrom
seer/fix/convert-timestamp-iso-format
Oct 28, 2026
Merged

Khairajani merged 2 commits into
mainfrom
seer/fix/convert-timestamp-iso-format

Conversation

@sentry

@sentry sentry Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Updated convert_timestamp in metadata/utils/time_utils.py to accept ISO-8601 datetime strings (including space-separated timestamps and trailing Z/offsets) alongside the existing epoch seconds and milliseconds strings. Timezone-naive datetimes are treated as UTC, and a helpful ValueError is raised with the offending value when parsing fails.

Running the columnValuesToBeBetween data quality test on datetime/timestamp columns failed when bounds were configured as ISO strings (such as '2022-12-01T00:00:00' or '2022-08-09 08:08:34.433967'). convert_timestamp assumed the string was numeric, so it raised ValueError: could not convert string to float. The test suite then reported an execution error instead of evaluating the column values.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

  • columnValuesToBeBetween on datetime/timestamp columns with ISO-string bounds is evaluated instead of erroring.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated: ingestion/tests/unit/metadata/utils/test_time_utils.py
  • Added parameterized unit tests covering epoch seconds, epoch milliseconds, ISO strings (T-separated, space-separated with microseconds, Z, explicit timezone offsets, bare dates, whitespace trimming) and invalid inputs.
  • Verified tests pass across supported Python versions (3.10 and 3.14).
  • Verified ruff check and formatting pass.

Backend integration tests

  • I added integration tests in openmetadata-integration-tests/ for new/changed API endpoints.
  • Not applicable (no backend API changes).

Ingestion integration tests

  • I added/updated ingestion integration tests for connector changes.
  • I ran the integration tests covering my changed files locally.
  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

UI screen recording:

Not applicable — backend-only work in an ingestion utility; no UI changes.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.

  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md). This description is gone from git log after the squash-merge.

  • Bug fix: I have added a test that covers the exact scenario we are fixing.

Fixes COLLATE-INGESTION-W7

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

convert_timestamp now accepts ISO datetime strings alongside epoch seconds and milliseconds.

  • Timestamp conversion accepts ISO dates alongside epoch values.

No actionable issues were found. Tests were inspected, not executed.

Reviews (1) · Last reviewed commit: "fix(ingestion): support ISO datetime str..." · Reviewed by Greptile

@sentry
sentry Bot requested a review from a team as a code owner October 23, 2026 23:16
@sentry
sentry Bot requested a review from Khairajani October 23, 2026 23:16
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Khairajani Khairajani added the safe to test Add this label to run secure Github workflows on PRs label Oct 28, 2026
@sonarqubecloud

Copy link
Copy Markdown

@Khairajani
Khairajani added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 637415b Oct 28, 2026
69 checks passed
@Khairajani
Khairajani deleted the seer/fix/convert-timestamp-iso-format branch October 28, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant