Skip to content

fix(sql_database): map Oracle TIMESTAMP WITH LOCAL TIME ZONE to timezone=true - #4343

Open
Aryan-Pardeshi wants to merge 1 commit into
dlt-hub:develfrom
Aryan-Pardeshi:fix/4315-oracle-local-timezone
Open

fix(sql_database): map Oracle TIMESTAMP WITH LOCAL TIME ZONE to timezone=true#4343
Aryan-Pardeshi wants to merge 1 commit into
dlt-hub:develfrom
Aryan-Pardeshi:fix/4315-oracle-local-timezone

Conversation

@Aryan-Pardeshi

Copy link
Copy Markdown

Fixes #4315

Problem

sqla_col_to_column_schema infers timezone-awareness from sql_t.timezone only. Oracle's TIMESTAMP WITH LOCAL TIME ZONE columns are reflected by SQLAlchemy with timezone=False but local_timezone=True, so they were mapped to timezone: false in the dlt schema — forcing downstream timestamp normalization and breaking round-trips for LTZ data.

Change

Also honor the local_timezone attribute (Oracle-only), via getattr so other dialects are unaffected.

Tests

  • test_oracle_local_time_zone_mapped_to_timezone_trueTIMESTAMP(local_timezone=True)timezone: true
  • test_oracle_timestamp_plain_maps_to_timezone_false — plain TIMESTAMP stays timezone: false

Verified: tests/sources/sql_database/test_schema_types.py — 19 passed under SQLAlchemy 2.0.51 and 2.1.0b3.

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.

sql_database source: Oracle TIMESTAMP WITH LOCAL TIME ZONE reflects as timezone=False even though SQLAlchemy correctly sets local_timezone=True

1 participant