Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adds pyodbc output converter for DATETIMEOFFSET data types #346

Merged
merged 8 commits into from
May 19, 2023

Conversation

baldwicc
Copy link
Contributor

@baldwicc baldwicc commented Apr 13, 2023

Fixes #253, supercedes #254

pyodbc is unlikley to include a handler for DATETIMEOFFSET data types - see mkleehammer/pyodbc#134.

So, this PR adds support to convert these datatypes to standard datetime objects based on public MS documentation.

This should allow freshness functonality to use DATETIMEOFFSET columns without needing to use CAST/CONVERT in loaded_at_field resource properties.

Tests are against str(value: datetime) default string format, since this asserts compatibility with:

@baldwicc baldwicc marked this pull request as ready for review April 13, 2023 11:27
@baldwicc baldwicc changed the title Datetimeoffset patch fix: adds pyodbc output converter for DATETIMEOFFSET data types Apr 13, 2023
@baldwicc baldwicc marked this pull request as draft April 13, 2023 11:38
@baldwicc baldwicc marked this pull request as ready for review April 13, 2023 11:52
@baldwicc baldwicc force-pushed the datetimeoffset-patch branch from f3cb585 to 3e7ef16 Compare April 13, 2023 12:25
@sdebruyn sdebruyn self-assigned this May 17, 2023
@sdebruyn sdebruyn force-pushed the datetimeoffset-patch branch from 3e7ef16 to d620ee7 Compare May 17, 2023 20:45
@sdebruyn
Copy link
Member

@baldwicc Thank you! Sorry for the long wait, merging this today

@sdebruyn sdebruyn force-pushed the datetimeoffset-patch branch from 6b216ca to 4307e4f Compare May 18, 2023 19:46
@sdebruyn sdebruyn merged commit 8a75db9 into dbt-msft:master May 19, 2023
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.

Cannot use dbt source freshness with DATETIMEOFFSET column types
3 participants