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

fix: check if results are empty #881

Closed
wants to merge 1 commit into from
Closed

Conversation

alaeddine-13
Copy link

Fixing encoding of a dataset using cas.
To reproduce:
download this file https://jinaai.slack.com/files/U026WRMRL6A/F04GE6JKX0U/dataset.csv

then:

from docarray import DocumentArray, Document
with open('dataset.csv') as fp:
  da = DocumentArray.from_csv(fp)

from clip_client import Client

c = Client(
    'grpcs:https://api.clip.jina.ai:2096', credential={'Authorization': 'atuh-token'}
)

encoded_da = c.encode(da, show_progress=True)

@alaeddine-13
Copy link
Author

now a server side issue happens:

    raise _create_rpc_error(await self.initial_metadata(), await
grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "HTTP Balancer service in fail-fast |Gateway: Communication error with deployment clip_t at address(es) {'clip-t.grpc-flow.svc:8080'}. Head or worker(s) may be down."
	debug_error_string = "{"created":"@1671719158.543427000","description":"Error received from peer ipv4:52.58.81.82:2096","file":"src/core/lib/surface/call.cc","file_line":967,"grpc_message":"HTTP Balancer service in fail-fast |Gateway: Communication error with deployment clip_t at address(es) {'clip-t.grpc-flow.svc:8080'}. Head or worker(s) may be down.","grpc_status":14}"

@@ -165,7 +165,7 @@ def _gather_result(
response, results: 'DocumentArray', attribute: Optional[str] = None
):
r = response.data.docs
if attribute:
if attribute and len(r) > 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally len(r)>0 must hold

@@ -165,7 +165,7 @@ def _gather_result(
response, results: 'DocumentArray', attribute: Optional[str] = None
):
r = response.data.docs
if attribute:
if attribute and len(r) > 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this line?

@ZiniuYu
Copy link
Member

ZiniuYu commented Mar 2, 2023

closing it since it's a connection issue

@ZiniuYu ZiniuYu closed this Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants