mirror of
https://github.com/hwchase17/langchain.git
synced 2025-10-26 21:33:56 +00:00
separate columns by tabs instead of single space in sql sample rows (#1348)
Use tabs to separate columns instead of a single space - confusing when there are spaces in a cell
This commit is contained in:
@@ -133,7 +133,7 @@ class SQLDatabase:
|
||||
)
|
||||
|
||||
# save the columns in string format
|
||||
columns_str = " ".join([col.name for col in table.columns])
|
||||
columns_str = "\t".join([col.name for col in table.columns])
|
||||
|
||||
try:
|
||||
# get the sample rows
|
||||
@@ -145,7 +145,7 @@ class SQLDatabase:
|
||||
)
|
||||
|
||||
# save the sample rows in string format
|
||||
sample_rows_str = "\n".join([" ".join(row) for row in sample_rows])
|
||||
sample_rows_str = "\n".join(["\t".join(row) for row in sample_rows])
|
||||
|
||||
# in some dialects when there are no rows in the table a
|
||||
# 'ProgrammingError' is returned
|
||||
|
||||
Reference in New Issue
Block a user