Fix Redshift timestamp precision parsing#27524
Fix Redshift timestamp precision parsing#27524PRADDZY wants to merge 1 commit intoopen-metadata:mainfrom
Conversation
|
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! |
Code Review ✅ ApprovedUpdates the Redshift timestamp parser to correctly handle precision modifiers. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
There was a problem hiding this comment.
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_kwargsto force empty positional args fortime/timestamptypes and setprecision/timezonevia 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. |
Summary
Fixes #24106
Root Cause
Redshift reports types like
timestamp(0) without time zone. The parser extracted(0)as a positional argument and also settimezone=False, so SQLAlchemy received both a positional timezone value and atimezonekeyword.Validation
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.pyPYTHONPATH=ingestion/src python -m pytest ingestion/tests/unit/topology/database/test_redshift_utils.py -qcurrently stops during global test setup in this checkout becausemetadata.generatedis absent.