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(postgres): cannot connect to postgres table with tsvector column #5402

Closed
1 task done
gforsyth opened this issue Feb 1, 2023 · 2 comments · Fixed by #5647
Closed
1 task done

bug(postgres): cannot connect to postgres table with tsvector column #5402

gforsyth opened this issue Feb 1, 2023 · 2 comments · Fixed by #5647
Labels
bug Incorrect behavior inside of ibis

Comments

@gforsyth
Copy link
Member

gforsyth commented Feb 1, 2023

What happened?

Reposting from https://stackoverflow.com/questions/74520302/why-cant-i-connect-ibis-to-a-postgres-table-with-a-tsvector-column

Implementing whatever postgres functionality exists around tsvector may not be something we want to do, but I think we should at least allow connecting to the table.

What version of ibis are you using?

3.2.0

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

postgres

Relevant log output

KeyError                                  Traceback (most recent call last)
File ~/anaconda3/envs/ec_extract/lib/python3.9/site-packages/multipledispatch/dispatcher.py:269, in Dispatcher.__call__(self, *args, **kwargs)
    268 try:
--> 269     func = self._cache[types]
    270 except KeyError:

KeyError: (<class 'sqlalchemy.dialects.postgresql.psycopg2.PGDialect_psycopg2'>, <class 'sqlalchemy.dialects.postgresql.base.TSVECTOR'>)

During handling of the above exception, another exception occurred:

NotImplementedError                       Traceback (most recent call last)
*** 
----> 29 main_table = con.table(table_name)[columns['column_list']]

File ~/anaconda3/envs/ec_extract/lib/python3.9/site-packages/ibis/backends/base/sql/alchemy/__init__.py:438, in BaseAlchemyBackend.table(self, name, database, schema)
    428     return self.database(database=database).table(
    429         name=name,
    430         database=database,
    431         schema=schema,
    432     )
    433 sqla_table = self._get_sqla_table(
    434     name,
...
    275             (self.name, str_signature(types)))
    276     self._cache[types] = func
    277 try:

NotImplementedError: Could not find signature for dtype: <PGDialect_psycopg2, TSVECTOR>

Code of Conduct

  • I agree to follow this project's Code of Conduct
@gforsyth gforsyth added the bug Incorrect behavior inside of ibis label Feb 1, 2023
@cpcloud cpcloud changed the title bug: cannot connect to postgres table with tsvector column bug(postgres): cannot connect to postgres table with tsvector column Feb 2, 2023
@cpcloud
Copy link
Member

cpcloud commented Feb 2, 2023

What should we infer this type as? String?

@gforsyth
Copy link
Member Author

gforsyth commented Feb 2, 2023

I think that's what makes the most sense given what we currently support. We won't have any of the specialized string vector methods, but at least users can interact with the rest of the table.

gforsyth added a commit to gforsyth/ibis that referenced this issue Mar 1, 2023
Fixes ibis-project#5402

The `tsvector` type is a postgres-specific type for fast text search --
this doesn't add support for using any of the specific features
associated with `tsvector` but it will let a user load a table that
contains them, instead of erroring out.
cpcloud pushed a commit that referenced this issue Mar 2, 2023
Fixes #5402

The `tsvector` type is a postgres-specific type for fast text search --
this doesn't add support for using any of the specific features
associated with `tsvector` but it will let a user load a table that
contains them, instead of erroring out.
thegreymatter pushed a commit to thegreymatter/ibis that referenced this issue Mar 5, 2023
Fixes ibis-project#5402

The `tsvector` type is a postgres-specific type for fast text search --
this doesn't add support for using any of the specific features
associated with `tsvector` but it will let a user load a table that
contains them, instead of erroring out.
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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants