-
Notifications
You must be signed in to change notification settings - Fork 12
Seed files throw pyodbc error HY000 #6
Comments
Someone in my office had a similar issue, which was referenced in the latest release, |
@jacobm001, this issue happened with the latest release ( I also ran I also noticed that my profile with Error from dbt-integration-test
|
It looks like I ran into a build tool error and ended up committing a breaking change without realizing it... My apologies. I am currently traveling for work, but will try to resolve these issues this weekend. |
@jacobm001 Roger that. Looking forward to it. In the mean time, I have been looking into |
@jacobm001, heads up! When you get back to it this weekend, for Line 1 in Currently ( If so, I think the macro I apologize. I haven't had a chance to test locally. However, if that change does need to be made, then Lines 36 through 39 in |
This issue was caused by the `package_data` variable being setup incorrectly in `setup.py`. Apparently the file listing is **not** recursive, which caused the `sdist` files to lack several macro overrides needed to function.
I have confirmed that this issue is due to my tooling. While the |
* Fixed issue jacobm001#6. This issue was caused by the `package_data` variable being setup incorrectly in `setup.py`. Apparently the file listing is **not** recursive, which caused the `sdist` files to lack several macro overrides needed to function. * Added a note about the ODBC driver As noted in issue jacobm001#5, the use of the `driver` variable was not particularly clear. I've added some info to try and explain that configuration better. * altered mssql__create_view_as macros Looks like this issue is being caused by the `mssql__create_view_as` macro. It works fine if the sql it's provided does not contain a CTE. If it does, sql server considers it a syntax error. This commit removes the parenthesis wrapping the `{{ sql }}` portion. * Fixed CTEs with insert into statements SQL Server's `insert into` syntax isn't nearly as forgiving as in other databases. In the previous version I had created a cte as apart of the into statement that could later be referenced. This worked so long as your source model didn't contain a CTE of its own. If it did, that put a CTE declaration inside another CTE which broke everything. I've taken a que from the dbt-sqlserver package and am now creating a "temporary" view to handle the issue. Thanks @mikaelene for the example. * incremented version number * Update README.md * updated .gitignore * delt with empty column names It appears that issue jacobm001#10 is caused by MSSQL not returning default column names for aggregate functions through the odbc library. When the `''` column name hits the agate library, an error is thrown. To handle this behavior, I've overridden the class method, `get_result_from_cursor()`. The new method loops through all the column names and replaces any instances of `''` with `unnamed_column-{i}`. This should provide a simple work around that the user doesn't really see, but is also very easy for the user to avoid if it's undesired behaivor. * incremented version * Update README.md * initial commit * added catalog * added work from https://github.com/norton120/dbt-azuredatawarehouse * moved to explicit varchar size per https://docs.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-tables-data-types * handle empty string column name from scalar * update README to match dockerfile * added sample profile.yml * clean up git conflict noise in readme * known issues in readme * added process_results class method and updated sql connection type Co-authored-by: Jacob Mastel <[email protected]> Co-authored-by: Isaac Chavez <[email protected]> Co-authored-by: Ethan Knox <[email protected]>
Summary
I ran into an error
HY000
frompyodbc
after runningdbt seed
while trying to recreatejaffle_shop
tutorial fordbt
at https://github.com/fishtown-analytics/jaffle_shopWhat happened:
jaffle_shop
profile in~/.dbt/profiles.yml
usingtype: mssql
driver: 'ODBC Driver 17 for SQL Server'
...
jaffle_shop
directorydbt debug
<- ALL GREEN SUCCESS OKsdbt seed
<- ERRORs thrown for all three CSVs injaffle_shop
data
directory. See below.What I expected to happen:
I expected the 3 CSVs in
/path/to/jaffle_shop/data/
to be loaded into tables on my database.Errors
Environment Details
python
version,pyodbc
version etcThe text was updated successfully, but these errors were encountered: