fixes mapping views - #5
Conversation
|
Is there anything I can do to help you guys implement this minor fix? |
Add missing dtypes and method for reflection
… well as table descriptions
add geometry type support
Version bump - support added for geometry.
modify column reflection to return complete type info
- Migrate dialect architecture to SQLAlchemy 2.0+ DefaultDialect with query caching (supports_statement_cache = True) - Add non-blocking asynchronous dialect (vertica+vertica_python_async://) supporting create_async_engine and AsyncSession - Add native Alembic migration plugin (VerticaImpl) with transactional DDL and index no-op handling - Add complete Vertica data types (GEOMETRY, GEOGRAPHY, UUID, LONG VARCHAR, LONG VARBINARY, ARRAY, MAP, ROW, TIMESTAMPTZ, TIMETZ, INTERVAL) - Add complete parameterized reflection for tables, views, primary keys, foreign keys, unique/check constraints, comments, and schemas - Modernize packaging to PEP 517/621 with pyproject.toml and driver extras - Drop six and Python 2 legacy code in favor of modern Python 3.9-3.14+ typing - Add comprehensive unit test suite with 95% pytest test coverage
…ation Upgrade to SQLAlchemy 2.0+, Async Engine, and Alembic Support
Greptile SummaryThe PR substantially modernizes the dialect for SQLAlchemy 2.x while extending reflection so views can resolve table IDs and columns.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking cleanup issue where the async adapter hides cursor and connection close failures. The view-aware reflection changes have no established blocking defect, but unconditional exception suppression during async cleanup can conceal failed resource release and make connection leaks difficult to detect. Files Needing Attention: sqlalchemy_vertica/dialect_vertica_python_async.py Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
SA[SQLAlchemy reflection] --> OID[get_table_oid]
OID --> T[v_catalog.tables]
OID --> V[v_catalog.views]
SA --> C[get_columns]
C --> TC[v_catalog.columns]
C --> VC[v_catalog.view_columns]
SA --> D[Driver dialect]
D --> VP[vertica-python]
D --> PY[PyODBC]
D --> TU[turbodbc]
D --> AS[Async adapter]
AS --> TH[Thread-offloaded vertica-python calls]
Prompt To Fix All With AI### Issue 1
sqlalchemy_vertica/dialect_vertica_python_async.py:63-67
**Close failures are silently discarded**
When the Vertica driver raises while closing an async cursor or connection, these adapters discard the exception and report successful cleanup, hiding resource leaks and preventing the pool from recognizing an unusable connection. The connection adapter repeats this behavior at lines 95–99.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Merge pull request #6 from lv10/feature/..." | Re-trigger Greptile |
| async def close(self) -> None: | ||
| try: | ||
| await asyncio.to_thread(self._sync_cursor.close) | ||
| except Exception: | ||
| pass |
There was a problem hiding this comment.
Close failures are silently discarded
When the Vertica driver raises while closing an async cursor or connection, these adapters discard the exception and report successful cleanup, hiding resource leaks and preventing the pool from recognizing an unusable connection. The connection adapter repeats this behavior at lines 95–99.
Prompt To Fix With AI
This is a comment left during a code review.
Path: sqlalchemy_vertica/dialect_vertica_python_async.py
Line: 63-67
Comment:
**Close failures are silently discarded**
When the Vertica driver raises while closing an async cursor or connection, these adapters discard the exception and report successful cleanup, hiding resource leaks and preventing the pool from recognizing an unusable connection. The connection adapter repeats this behavior at lines 95–99.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Problem:
SQLAlchemy-Vertica was able to see view names but I wasn't able to query data from views. The view (aka table id) was only obtained for tables not views.
Solution:
Add a union statement so that views can be obtained and queried.