Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion libs/astradb/tests/integration_tests/test_vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,15 @@

def is_nvidia_vector_service_available() -> bool:
# For the time being, this is manually controlled
return os.getenv("NVIDIA_VECTORIZE_AVAILABLE") == "1"
if os.environ.get("NVIDIA_VECTORIZE_AVAILABLE"):
try:
# any non-zero counts as true:
return int(os.environ["NVIDIA_VECTORIZE_AVAILABLE"]) != 0
except (TypeError, ValueError):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don’t think it can be TypeError

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Then I would do ˋreturn int(os.getenv(NVIDIA, "0"))ˋ and remove the if clause.

# the env var has unparsable contents:
return False
else:
return False


@pytest.fixture
Expand Down