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

dbt show fails with 'DatabricksSQLCursorWrapper' object has no attribute 'fetchmany' #408

Closed
NodeJSmith opened this issue Aug 7, 2023 · 1 comment · Fixed by #440
Closed
Labels
bug Something isn't working

Comments

@NodeJSmith
Copy link

Describe the bug

Running dbt show --select {model_name} fails with exception 'DatabricksSQLCursorWrapper' object has no attribute 'fetchmany'.

Steps To Reproduce

  • sample_model.sql
SELECT 1 as test_column

Execute dbt show:

dbt show --select sample_model

image

Expected behavior

Output of column and value 1

Screenshots and log output

Potentially relevant pip package versions:
image

System information

The output of dbt --version:

Core:
  - installed: 1.6.0
  - latest:    1.6.0 - Up to date!

Plugins:
  - databricks: 1.6.1 - Up to date!
  - spark:      1.6.0 - Up to date!

The operating system you're using:
LSB Version: core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch

The output of python --version:
Python 3.10.12

@NodeJSmith NodeJSmith added the bug Something isn't working label Aug 7, 2023
@NodeJSmith
Copy link
Author

NodeJSmith commented Aug 7, 2023

This seems to be solved by just adding the below to DatabricksSQLCursorWrapper. I assumed that this library would be used often enough that if this was all it was it would have been fixed already, so I'm not sure if I'm missing something. I'm happy to put in a PR for this.

    def fetchmany(self, size) -> List[Tuple]:
        return self._cursor.fetchmany(size)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant