langchain/libs
maang-h fc93bed8c4
community: Fix CSVLoader columns is None (#20701)
- **Bug code**: In
langchain_community/document_loaders/csv_loader.py:100

- **Description**: currently, when 'CSVLoader' reads the column as None
in the 'csv' file, it will report an error because the 'CSVLoader' does
not verify whether the column is of str type and does not consider how
to handle the corresponding 'row_data' when the column is' None 'in the
csv. This pr provides a solution.

- **Issue:**  Fix #20699 

- **thinking:**

1. Refer to the processing method for
'langchain_community/document_loaders/csv_loader.py:100' when **'v'**
equals'None', and apply the same method to '**k**'.
(Reference`csv.DictReader` ,**'k'** will only be None when `
len(columns) < len(number_row_data)` is established)
2. **‘k’** equals None only holds when it is the last column, and its
corresponding **'v'** type is a list. Therefore, I referred to the data
format in 'Document' and used ',' to concatenated the elements in the
list.(But I'm not sure if you accept this form, if you have any other
ideas, communicate)

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
2024-05-22 12:57:46 -07:00
..
cli cli[minor]: fix import path for two Astra DB classes in the migration json data (#21926) 2024-05-20 12:25:10 -04:00
community community: Fix CSVLoader columns is None (#20701) 2024-05-22 12:57:46 -07:00
core core[patch]: Release 0.2.1 (#22003) 2024-05-22 00:05:04 +00:00
experimental experimental[patch]: Pass enum only to openai in llm graph transformer (#21860) 2024-05-20 15:02:48 -07:00
langchain langchain: added revision_example prompt template (#20916) 2024-05-22 19:57:32 +00:00
partners robocorp: release 0.0.8 (#22034) 2024-05-22 16:41:41 +00:00
standard-tests core, standard tests, partner packages: add test for model params (#21677) 2024-05-17 13:51:26 -04:00
text-splitters infra: fix CI on text-splitters (#21935) 2024-05-20 14:03:42 -07:00