MCPcopy Create free account
hub / github.com/tmc/langchaingo / TestCSVLoaderWithFilteringColumns

Function TestCSVLoaderWithFilteringColumns

documentloaders/csv_test.go:34–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestCSVLoaderWithFilteringColumns(t *testing.T) {
35 t.Parallel()
36 file, err := os.Open("./testdata/test.csv")
37 require.NoError(t, err)
38
39 loader := NewCSV(file, "city")
40
41 ctx := context.Background()
42 docs, err := loader.Load(ctx)
43 require.NoError(t, err)
44 require.Len(t, docs, 20)
45
46 expected1 := "city: New York"
47 assert.Equal(t, docs[0].PageContent, expected1)
48
49 expected2 := "city: London"
50 assert.Equal(t, docs[1].PageContent, expected2)
51}

Callers

nothing calls this directly

Calls 2

LoadMethod · 0.95
NewCSVFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…