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

refactor(backends): remove singledispatchmethod from the sql backends #8338

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/support_matrix.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ hide:

```{python}
#| echo: false
from pathlib import Path

import pandas as pd

import ibis
Expand Down
10 changes: 6 additions & 4 deletions ibis/backends/base/sqlglot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ def dialect(self) -> sg.Dialect:

@classmethod
def has_operation(cls, operation: type[ops.Value]) -> bool:
# singledispatchmethod overrides `__get__` so we can't directly access
# the dispatcher
dispatcher = cls.compiler.visit_node.register.__self__.dispatcher
return dispatcher.dispatch(operation) is not dispatcher.dispatch(object)
compiler = cls.compiler
method = getattr(compiler, f"visit_{operation.__name__}", None)
return method is not None and method not in (
compiler.visit_Undefined,
compiler.visit_Unsupported,
)

def _fetch_from_cursor(self, cursor, schema: sch.Schema) -> pd.DataFrame:
import pandas as pd
Expand Down
Loading
Loading