Skip to content

Commit

Permalink
Merge pull request kuzudb#147 from kuzudb/fix-query
Browse files Browse the repository at this point in the history
Fix copy from with subquery with pandas
  • Loading branch information
prrao87 authored May 15, 2024
2 parents a4fd64c + 796c11d commit 700cd86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content/docs/import/copy-from-query-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ object, such as a Pandas DataFrame using `LOAD FROM` and use its results as inpu
command. This can be combined with predicate filters as follows:

```python
# Assumes that you have a Kùzu connection object named `conn`
# Also assumes that you created a node table named `Person` with columns `name` and `age`
# First, ensure you create a Kùzu connection object and define a node table as follows:
# conn.execute("CREATE NODE TABLE Person (name STRING, age INT64, PRIMARY KEY(name))")
import pandas as pd

df = pd.DataFrame({
"name": ["Adam", "Karissa", "Zhang", "Noura"],
"age": [30, 40, 50, 25]
})

conn.execute("COPY Person FROM (LOAD FROM df WHERE age < 30 RETURN *")
conn.execute("COPY Person FROM (LOAD FROM df WHERE age < 30 RETURN *)")
```

Using `COPY FROM` with subqueries in this manner opens up a wider
Expand Down

0 comments on commit 700cd86

Please sign in to comment.