-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
override seed column types when inferred to be of type agate_helper.ISODateTime
#4282
Comments
agate_helper.ISODateTime
agate_helper.ISODateTime
@swanderz Thanks for opening! The code for dbt is very used to the idea that different adapters may have a different data type name corresponding to each agate/python data type. This is implemented via the What's new and tricky about this issue is that the client/driver requires all binding parameters to be string type. That's much harder to work around, and the agate I do think there may be an entirely adapter-side workaround for this, which requires some clever materialization code:
Then, here's what I see:
By feeding the text-only values into
It's possible that the changes to prevent agate from type-coercing query results played a role here. I'd be surprised, though; we didn't touch agate's type inference for seeds at all. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest; add a comment to notify the maintainers. |
Is there an existing issue for this?
Current Behavior
this issue came up with dbt-firebolt because the JDBC driver doesn't like non-string bindings for prepared statements. My goal is to cast them all to strings.
the issue came up when using dbt-adapter-tests's base.csv. IIRC, this issue did not happen in dbt-core 0.20.0
line 49 of
agate_helper.build_type_tester()
(snippet below) results in anagate_table
wheresome_date
to be of type :ISODateTime
. commenting out line 49 fixes this problem, as it allows the values in agate table to be overridden.dbt-core/core/dbt/clients/agate_helper.py
Lines 43 to 54 in d833c8e
it is insufficient to modify
adapter.convert_datetime_type
because that will only change the column's type, not the actual values. though, in my head, I thought that this would work.logging/diagnosis
logging set up
here's the log statements I added to
seed.sql
logging output
however, if I comment out line 49 from above, then not only is the column type changed to be of type
TEXT
but also the parameters in theINSERT INTO ... VALUES
statement also become strings.Expected Behavior
I expect that
adapter.convert_datetime_type()
would allow any seed column that's datetime-like to be overrided to the returned type. However, this does not work if the column type is inferred to beagate_helper.ISODateTime
.Environment
What database are you using dbt with?
firebolt==0.20.2
The text was updated successfully, but these errors were encountered: