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

fix pandas support #388

Merged
merged 3 commits into from
Feb 6, 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: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: SneaksAndData/github-actions/semver_release@v0.1.0
with:
major_v: 2
minor_v: 6
minor_v: 7
5 changes: 3 additions & 2 deletions adapta/storage/database/odbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from pandas import DataFrame, read_sql
import sqlalchemy
from sqlalchemy import text
from sqlalchemy.connectors import pyodbc
from sqlalchemy.engine import URL
from sqlalchemy.exc import SQLAlchemyError, OperationalError
Expand Down Expand Up @@ -171,9 +172,9 @@ def materialize(
if overwrite:
try:
if self._dialect.dialect == DatabaseType.SQLITE_ODBC.value.dialect:
self._get_connection().execute(f"DELETE FROM {schema}.{name}")
self._get_connection().execute(text(f"DELETE FROM {schema}.{name}"))
else:
self._get_connection().execute(f"TRUNCATE TABLE {schema}.{name}")
self._get_connection().execute(text(f"TRUNCATE TABLE {schema}.{name}"))
except OperationalError as ex:
# The table does not exist. Do nothing and let the Pandas API handle the creation of the table.
self._logger.warning(
Expand Down
Loading
Loading