Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omitting _key hangs _BatchWriter #152

Open
alexander-matsievsky opened this issue Sep 10, 2020 · 0 comments
Open

Omitting _key hangs _BatchWriter #152

alexander-matsievsky opened this issue Sep 10, 2020 · 0 comments
Labels

Comments

@alexander-matsievsky
Copy link
Member

Failing

# reprex.py
import os

import scrapinghub

store = (
    scrapinghub.ScrapinghubClient(os.getenv('SH_APIKEY'))
    .get_project(1234567890)
    .collections.get_store("ok_to_mess_around_with")
)

writer = store.create_writer()

writer.write({"foo": "bar"})
print("write")

writer.write({"fizz": "buzz"})
print("write")

writer.flush()
print("flush")
python reprex.py 

write
write
^CTraceback (most recent call last):
...
KeyboardInterrupt

Passing

import os

import scrapinghub

store = (
    scrapinghub.ScrapinghubClient(os.getenv('SH_APIKEY'))
    .get_project(1234567890)
    .collections.get_store("ok_to_mess_around_with")
)

writer = store.create_writer()

writer.write({"_key": "foo", "foo": "bar"})
print("write")

writer.write({"_key": "fizz", "fizz": "buzz"})
print("write")

writer.flush()
print("flush")
python reprex.py

write
write
flush
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant