Skip to content
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.4.6]

* **fix: normalize teradata column names to lowercase for Enterprise compatibility**

## [1.4.5]

* **fix: add capability to use opensearch serverless**
Expand Down
2 changes: 1 addition & 1 deletion unstructured_ingest/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.5" # pragma: no cover
__version__ = "1.4.6" # pragma: no cover
4 changes: 2 additions & 2 deletions unstructured_ingest/processes/connectors/sql/teradata.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def query_db(self, file_data: SqlBatchFileData) -> tuple[list[tuple], list[str]]
logger.debug(f"running query: {query}\nwith values: {ids}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests verify the .lower() behavior - consider adding a unit test that mocks cursor.description returning uppercase column names and asserts the result is lowercase. Important for regression prevention since this fixes a production bug.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snowflake connector handles the same ANSI SQL identifier uppercasing via _fit_to_schema(case_sensitive=False) in the base class. Worth considering that pattern here for consistency, though the immediate fix is correct.

cursor.execute(query, ids)
rows = cursor.fetchall()
columns = [col[0] for col in cursor.description]
columns = [col[0].lower() for col in cursor.description]
return rows, columns


Expand Down Expand Up @@ -202,7 +202,7 @@ def get_table_columns(self) -> list[str]:
if self._columns is None:
with self.get_cursor() as cursor:
cursor.execute(f'SELECT TOP 1 * FROM "{self.upload_config.table_name}"')
self._columns = [desc[0] for desc in cursor.description]
self._columns = [desc[0].lower() for desc in cursor.description]
return self._columns

def delete_by_record_id(self, file_data: FileData) -> None:
Expand Down
Loading