Skip to content

Commit

Permalink
pand test
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Aug 13, 2024
1 parent e259dd6 commit e67ef5c
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions packages/sample/genaisrc/pandas.genai.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
const container = await host.container({ image: "python:3", networkEnabled: true })
await container.exec("pip", ["install", "--root-user-action", "ignore", "pandas"])
await container.writeText("main.py", `import pandas as pd
script({ tests: {} })
const container = await host.container({
image: "python:3.12",
networkEnabled: true,
})
await container.exec("pip", [
"install",
"--root-user-action",
"ignore",
"pandas",
])
await container.writeText(
"main.py",
`import pandas as pd
print(pd)
`)
const res = await container.exec('python', ["main.py"])
console.log(YAML.stringify(res))
`
)
const res = await container.exec("python", ["main.py"])
if (res.failed) throw new Error("import failed")

0 comments on commit e67ef5c

Please sign in to comment.