Skip to content

Commit

Permalink
fix pandas support (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeppe742 authored Feb 6, 2024
1 parent 7144434 commit 0496879
Show file tree
Hide file tree
Showing 4 changed files with 757 additions and 603 deletions.
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

0 comments on commit 0496879

Please sign in to comment.