Skip to content

Commit

Permalink
fix temp file
Browse files Browse the repository at this point in the history
  • Loading branch information
amkarkhi committed Oct 25, 2024
1 parent 63700f9 commit 7ab9afb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/tests/integration/dataframe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,8 @@ func TestDataFrame_FreqItems(t *testing.T) {

func TestDataFrame_WithOption(t *testing.T) {
ctx, spark := connect()
filepath := "/tmp/test.csv"
file, err := os.Create(filepath)
file, err := os.CreateTemp("", "example")
defer os.Remove(file.Name())
assert.NoError(t, err)
defer file.Close()
_, err = file.WriteString("id#name,name\n")
Expand All @@ -716,11 +716,9 @@ func TestDataFrame_WithOption(t *testing.T) {
Option("escapeQuotes", "true").
// Option("skipLines", "5"). //TODO: this needs more insight
Option("inferSchema", "false").
Load(filepath)
Load(file.Name())
assert.NoError(t, err)
c, err := df.Count(ctx)
assert.NoError(t, err)
assert.Equal(t, int64(10), c)
err = os.Remove(filepath)
assert.NoError(t, err)
}

0 comments on commit 7ab9afb

Please sign in to comment.