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

Bug FaissPostgress - int not parsed #208

Closed
florian-hoenicke opened this issue Sep 16, 2021 · 1 comment · Fixed by #173
Closed

Bug FaissPostgress - int not parsed #208

florian-hoenicke opened this issue Sep 16, 2021 · 1 comment · Fixed by #173
Assignees

Comments

@florian-hoenicke
Copy link
Member

When defining the pod via yaml, the shards and replicas are interpreted as string.
This leads to the exception bellow:

Config

- name: text_indexer
    shards: 1
    uses: 'jinahub+docker://FaissPostgresSearcher'
    uses_with:
      startup_sync_args:
        only_delta: true
      total_shards: shards
      hostname: postgres.postgres.svc.cluster.local
      username: postgresadmin
      database: postgresdb
      table: text_indexer

Error

File "/usr/local/lib/python3.7/site-packages/jinahub/indexers/searcher/FaissSearcher/faiss_searcher.py", line 129, in __init__
    self._load_dump(dump_path, dump_func, prefetch_size, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/jinahub/indexers/searcher/FaissSearcher/faiss_searcher.py", line 145, in _load_dump
    iterator = dump_func(shard_id=self.runtime_args.pea_id)
  File "/usr/local/lib/python3.7/site-packages/jinahub/indexers/storage/PostgreSQLStorage/postgres_indexer.py", line 264, in _get_delta
    shard_id, total_shards, self.virtual_shards
  File "/usr/local/lib/python3.7/site-packages/jinahub/indexers/storage/PostgreSQLStorage/postgres_indexer.py", line 239, in _vshards_to_get
    if shard_id > total_shards - 1:
TypeError: unsupported operand type(s) for -: 'str' and 'int'

cristianmtr added a commit that referenced this issue Sep 17, 2021
@cristianmtr
Copy link
Contributor

Can u try setting the

      total_shards: shards

to a number, instead of shards?

cristianmtr added a commit that referenced this issue Sep 17, 2021
@nan-wang nan-wang mentioned this issue Sep 18, 2021
cristianmtr added a commit that referenced this issue Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants