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: 'Backend' object has no attribute 'create_database' #8823

Closed
1 task done
mark-druffel opened this issue Mar 28, 2024 · 2 comments
Closed
1 task done

bug: 'Backend' object has no attribute 'create_database' #8823

mark-druffel opened this issue Mar 28, 2024 · 2 comments
Labels
bug Incorrect behavior inside of ibis
Milestone

Comments

@mark-druffel
Copy link

mark-druffel commented Mar 28, 2024

What happened?

Tried to create a database in duckdb so I could add tables from parquet. I am a Databricks environment hosted on Azure, not sure if that could be causing some issue...

import ibis
duck = ibis.duckdb.connect()
duck.create_database(name = "raw", force = True)

What version of ibis are you using?

Name: ibis-framework
Version: 8.0.0
Summary: Productivity-centric Python Big Data Framework
Home-page: https://ibis-project.org/
Author: Ibis Maintainers
Author-email: [email protected]
License: Apache-2.0
Location: /local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages
Requires: pyarrow-hotfix, bidict, toolz, pytz, python-dateutil, sqlglot, pandas, numpy, rich, parsy, typing-extensions, pyarrow, atpublic, multipledispatch
Required-by:

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

duckdb

Relevant log output

AttributeError: 'Backend' object has no attribute 'create_database'

Traceback (most recent call last):
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3550, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<command-2559220148720796>", line 2, in <module>
    duck.create_database(name = "raw", force = True)
AttributeError: 'Backend' object has no attribute 'create_database'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 2144, in showtraceback
    stb = self.InteractiveTB.structured_traceback(
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages/IPython/core/ultratb.py", line 1435, in structured_traceback
    return FormattedTB.structured_traceback(
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages/IPython/core/ultratb.py", line 1326, in structured_traceback
    return VerboseTB.structured_traceback(
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages/IPython/core/ultratb.py", line 1173, in structured_traceback
    formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context,
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages/IPython/core/ultratb.py", line 1088, in format_exception_as_a_whole
    frames.append(self.format_record(record))
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages/IPython/core/ultratb.py", line 970, in format_record
    frame_info.lines, Colors, self.has_colors, lvals
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-53895fb0-afd1-441d-be50-fb1373bfb7ec/lib/python3.9/site-packages/IPython/core/ultratb.py", line 792, in lines
    return self._sd.lines
  File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 698, in lines
    pieces = self.included_pieces
  File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 649, in included_pieces
    pos = scope_pieces.index(self.executing_piece)
  File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 628, in executing_piece
    return only(
  File "/databricks/python/lib/python3.9/site-packages/executing/executing.py", line 164, in only
    raise NotOneValueFound('Expected one value, found 0')
executing.executing.NotOneValueFound: Expected one value, found 0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mark-druffel mark-druffel added the bug Incorrect behavior inside of ibis label Mar 28, 2024
@cpcloud
Copy link
Member

cpcloud commented Mar 29, 2024

@mark-druffel Thanks for the issue!

I can't reproduce this on main (it's been implemented), but I can reproduce it on 8.0.0, so I'll close it out for now and it will ship in the next release.

@cpcloud cpcloud closed this as completed Mar 29, 2024
@github-project-automation github-project-automation bot moved this from backlog to done in Ibis planning and roadmap Mar 29, 2024
@cpcloud cpcloud added this to the 9.0 milestone Mar 29, 2024
@gforsyth
Copy link
Member

@mark-druffel -- as a temporary workaround you can specify a (non-existent) database as a connection parameter and it will be created automatically if you create any tables (or views), e.g.

duck = ibis.duckdb.connect("raw.ddb")

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
Projects
Archived in project
Development

No branches or pull requests

3 participants