Skip to content

Commit 1089a24

Browse files
authored
Merge pull request #173 from rethinkdb/fix-171-restore-primary-key
Fixing import command no primary key issue
2 parents 9aa68fe + 08c2739 commit 1089a24

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rethinkdb/_import.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ def __init__(
146146
self.write_hook = write_hook or []
147147

148148
# options
149-
self.source_options = source_options or {}
149+
self.source_options = source_options or {
150+
"create_args": {
151+
"primary_key": self.primary_key
152+
}
153+
}
150154

151155
# name
152156
if hasattr(self._source, 'name') and self._source.name:
@@ -249,7 +253,7 @@ def setup_table(self):
249253
ast.expr([self.table]).set_difference(
250254
query.db(self.db).table_list()
251255
).for_each(query.db(self.db).table_create(
252-
query.row, **self.source_options.create_args if 'create_args' in self.source_options else {})
256+
query.row, **self.source_options["create_args"] if 'create_args' in self.source_options else {})
253257
)
254258
)
255259

0 commit comments

Comments
 (0)