Skip to content

Fix Redshift timestamp precision parsing#27524

Open
PRADDZY wants to merge 1 commit intoopen-metadata:mainfrom
PRADDZY:hackathon/fix-redshift-timestamp-precision
Open

Fix Redshift timestamp precision parsing#27524
PRADDZY wants to merge 1 commit intoopen-metadata:mainfrom
PRADDZY:hackathon/fix-redshift-timestamp-precision

Conversation

@PRADDZY
Copy link
Copy Markdown

@PRADDZY PRADDZY commented Apr 19, 2026

Summary

  • Parse Redshift time and timestamp precision as keyword arguments instead of positional arguments.
  • Preserve existing positional parsing for numeric and character varying types.
  • Add regression coverage for timestamp/time precision with and without time zone.

Fixes #24106

Root Cause

Redshift reports types like timestamp(0) without time zone. The parser extracted (0) as a positional argument and also set timezone=False, so SQLAlchemy received both a positional timezone value and a timezone keyword.

Validation

  • Focused local unittest harness for TestRedshiftColumnTypeParsing: 4 tests passing.
  • python -m py_compile ingestion\src\metadata\ingestion\source\database\redshift\utils.py ingestion\tests\unit\topology\database\test_redshift_utils.py
  • PYTHONPATH=ingestion/src python -m pytest ingestion/tests/unit/topology/database/test_redshift_utils.py -q currently stops during global test setup in this checkout because metadata.generated is absent.

@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!

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 19, 2026

Code Review ✅ Approved

Updates the Redshift timestamp parser to correctly handle precision modifiers. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@PRADDZY PRADDZY marked this pull request as ready for review April 19, 2026 14:47
@PRADDZY PRADDZY requested a review from a team as a code owner April 19, 2026 14:47
Copilot AI review requested due to automatic review settings April 19, 2026 14:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Redshift column type parsing for time/timestamp types that include precision (e.g., timestamp(0) without time zone) by ensuring precision is passed as a keyword argument rather than being interpreted as a positional argument that conflicts with SQLAlchemy’s timezone parameter.

Changes:

  • Update _get_args_and_kwargs to force empty positional args for time/timestamp types and set precision/timezone via kwargs.
  • Add regression unit tests validating correct parsing/instantiation for time and timestamp types (with/without time zone) and ensuring numeric/varchar positional parsing remains unchanged.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ingestion/src/metadata/ingestion/source/database/redshift/utils.py Ensures time/timestamp precision is not passed positionally, avoiding duplicate timezone argument errors in SQLAlchemy.
ingestion/tests/unit/topology/database/test_redshift_utils.py Adds regression coverage for parsing/instantiation of Redshift time/timestamp precision and confirms existing positional parsing for other types is preserved.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redshift ingestion fails with "TIMESTAMP.__init__() got multiple values for argument 'timezone'" on timestamp(0) without time zone columns

2 participants