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

bug: create_table() to non-default 'database' not working (mssql) #9538

Closed
1 task done
nikdotcodes opened this issue Jul 8, 2024 · 2 comments
Closed
1 task done
Labels
bug Incorrect behavior inside of ibis mssql The Microsoft SQL Server backend

Comments

@nikdotcodes
Copy link

What happened?

When trying to create_table() to anything other that 'dbo' results in an error
ibis.common.exceptions.UnsupportedOperationError: Creating tables in other databases is not supported by Postgres

Have tried using schema and database parameter, both failing - when using defaults, the table is created happily.

Example script

import ibis

mssql = ibis.mssql.connect(
        host="localhost",
        database="ibisdb",
        driver="ODBC Driver 17 for SQL Server"
    )
load_data = ibis.memtable({"values": [1, 2, 1, 2, 3, 2]})
ibis.set_backend(mssql)
mssql.create_table('nik_test', load_data.to_pyarrow(), database='fldr2', overwrite=True)
Traceback (most recent call last):
  File "c:\sc\AzureDevOps\FileLoader%20v2\fileloaderv2\to_inputfile\from_csv.py", line 44, in <module>
    mssql.create_table('nik_test', load_data.to_pyarrow(), database='fldr2', overwrite=True)
  File "C:\sc\AzureDevOps\FileLoader%20v2\.venv\Lib\site-packages\ibis\backends\mssql\__init__.py", line 455, in create_table
    raise com.UnsupportedOperationError(
ibis.common.exceptions.UnsupportedOperationError: Creating tables in other databases is not supported by Postgres

What version of ibis are you using?

9.1.0

What backend(s) are you using, if any?

Mssql

Relevant log output

Traceback (most recent call last):
  File "c:\sc\AzureDevOps\FileLoader%20v2\fileloaderv2\to_inputfile\from_csv.py", line 44, in <module>
    mssql.create_table('nik_test', load_data.to_pyarrow(), database='fldr2', overwrite=True)
  File "C:\sc\AzureDevOps\FileLoader%20v2\.venv\Lib\site-packages\ibis\backends\mssql\__init__.py", line 455, in create_table
    raise com.UnsupportedOperationError(
ibis.common.exceptions.UnsupportedOperationError: Creating tables in other databases is not supported by Postgres

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nikdotcodes nikdotcodes added the bug Incorrect behavior inside of ibis label Jul 8, 2024
@deepyaman
Copy link
Contributor

I believe this was fixed in #9434; can you try installing Ibis from main to get the latest (unreleased) version. You should be able to do something like pip install 'ibis-framework[mssql] @ git+https://github.com/ibis-project/ibis'. Alternatively, you can wait for the next release, if it's not urgent.

@gforsyth gforsyth added the mssql The Microsoft SQL Server backend label Jul 13, 2024
@github-project-automation github-project-automation bot moved this from backlog to done in Ibis planning and roadmap Jul 17, 2024
@gforsyth
Copy link
Member

This is fixed on main, definitely let us know if you still have problems creating tables outside of dbo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis mssql The Microsoft SQL Server backend
Projects
Archived in project
Development

No branches or pull requests

3 participants