-
Notifications
You must be signed in to change notification settings - Fork 683
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
batch_create does not report on 'store is read-only' errors #1932
Comments
Oh I was just about to file mine version of this issue... :) So I'll just add that I encountered similar problem, where batch command doesn't report this error either:
I was able to retrieve this error by switching to one-by-one loop via but calling this lines of code didn't report any errors, but no data were imported
for reference, it was discussed on slack with @StefanBogdan in this thread: https://weaviate.slack.com/archives/C017EG2SL3H/p1648577835143169 |
Hi @chris-aeviator (cc @StefanBogdan) I've tried this using curl to make sure this is not broken in Weaviate itself and I can't reproduce the problem. I get the correct error message. Steps to reproduce: I was running with the contextionary module, but that doesn't matter, should be the same with another or no module:
It reports the error correctly
So, I can't reproduce this. |
Hi, so I assumed the bug will be in python client... however since I've updated to v3.4.0 two days ago, so I thought I can give it a try and found out that I couldn't reproduce it anymore either. So I assume is has been fixed lately? |
Oh, thanks for following up @ju-bezdek, I was about to suggest creating a separate issue for your case. But maybe they are the same. Was there a recent fix around this somewhere in the python client, @StefanBogdan? |
Maybe @chris-aeviator could confirm what client and weaviate version he was on, to confirm this hypothesis too |
|
I just used some old code that was still using python client batch and realized it was not even throwing on any error. My ingest succeeded (empty data) and I was only able to see this error with data_object.create()
|
Thanks for the update, just to confirm: Is the error message valid?
Did you indeed try to send a number to a string field? Or do you expect this to be an (unrelated) bug? |
@etiennedi yes the error was valid, I was indeed trying to set a number as a string. |
Hi, sorry I missed my tag in here. The python client does not do any manipulation of the results. I would recommend using a callback function when using auto-batching. def check_batch_result(results: dict) -> None:
"""
Check batch results for errors.
Parameters
----------
results : dict
The Weaviate batch creation return value.
"""
if results is not None:
for result in results:
if 'result' in result and 'errors' in result['result']:
if 'error' in result['result']['errors']:
for message in result['result']['errors']['error']:
print(message['message'], flush=True)
client.batch.configure(
batch_size=BATCH_SIZE,
callback=check_batch_result,
...
) |
@StefanBogdan thanks for pointing this out, I will try this approach when I find the time to see if it solves my issue. Wouldnt it make sense to provide an on_error hook alongside the callback on the client level rather than expecting the user to do deeply nested checking for errors? |
@StefanBogdan You explained to me on slack, that there is no need to use callback if I wan't synch result... that I'll get the result dict as a response/output for create_object if callback is not provided. so this method of error detection
should get the same result... the only difference is that with callback the calls are asynchronous (which could lead to some performance gains I suppose Am I right, or I misunderstood you there? |
This is under development. |
@ju-bezdek I think you misunderstood. The current version of the python client does not support async functionality. The # auto-batching (when we set `batch_size` to a non-None value)
client.batch.configure(
batch_size=100,
callback=check_batch_result,
)
# is the same as
client.batch.configure(
batch_size=None,
)
check_batch_result(
client.batch.create_objects() # every time I call this method
) |
Ooooh... I seee, I wonder how I could get errors with my previous implementation when I was checking this again with v3.4.0 To double-check and also for other folks that can come across this... this is the right way, right?
|
Hi @ju-bezdek , you do not need this lines at all: i_can_ignore_this_result = batch.create_objects()
and_this_as_well = batch.create_references() the auto-batching does this for you, you should call the methods |
Thanks for correction... May I also suggest maybe to update documentation here? I suppose it's working example, but obviously it's not the recommended way and it may lead to this kind of issue reports:) |
Thank you for your contribution to Weaviate. This issue has not received any activity in a while and has therefore been marked as stale. Stale issues will eventually be autoclosed. This does not mean that we are ruling out to work on this issue, but it most likely has not been prioritized high enough in the last months. |
When using the python client
with client.batch
and having crossed theDISK_USE_READONLY_PERCENTAGE
my ingest fails when usingdata_object.create
but will seemingly succeed when using batches. However the ingest that succeeded using batch did not contain any items when running aGet
query though they have been processed by my t2v-transformers container.There might be other errors that are not covered by batch.create and I only found out through a helpful comment in Weaviate Slack and after running into my issue. This seems to also have been the issue with #1929 .
The text was updated successfully, but these errors were encountered: