Skip to content

Commit

Permalink
gh-7: adapted to new version of Weaviate
Browse files Browse the repository at this point in the history
  • Loading branch information
michaverhagen committed Jun 15, 2021
1 parent 6852f84 commit cfc7c25
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
weaviate:
#url: 'http://localhost:8080'
url: 'http://localhost:8080'
schema: './schema/schema.json'
wcs: 'demo-arxiv'
username: "WEAVIATE_USERNAME"
Expand Down
4 changes: 0 additions & 4 deletions modules/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,20 @@ def get_weaviate_client(instance: dict) -> weaviate.client:
if 'username' in instance and 'password' in instance:
username = os.getenv(instance['username'])
password = os.getenv(instance['password'])
print(instance['username'], username)
if username is not None and password is not None:
auth = weaviate.AuthClientPassword(username, password)

print(auth)
if 'url' in instance:
if auth is not None:
client = weaviate.Client(instance['url'], auth_client_secret=auth)
else:
client = weaviate.Client(instance['url'])

elif 'wcs' in instance:
print("trying wcs")
if auth is not None:
my_wcs = WCS(auth)
try:
result = my_wcs.get_cluster_config(instance['wcs'])
print(result)
weaviatepath = 'https://'+result['meta']['PublicURL']
except:
config = {}
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ pandas==1.1.2
beautifulsoup4==4.9.3
python_dateutil==2.8.1
PyYAML==5.4.1
lxml==4.6.3

0 comments on commit cfc7c25

Please sign in to comment.