Skip to content

Commit

Permalink
Emit an early error when a RemoeSparqlRepo is configured, but SPARQL_…
Browse files Browse the repository at this point in the history
…ENDPOINT is not provided in the settings file or the env var. (#262)
  • Loading branch information
ashleysommer authored Aug 28, 2024
1 parent 9424742 commit 06307aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prez/repositories/remote_sparql.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
class RemoteSparqlRepo(Repo):
def __init__(self, async_client: httpx.AsyncClient):
self.async_client = async_client
if not settings.sparql_endpoint:
raise ValueError(
"When using a remote SPARQL endpoint, "
"the SPARQL_ENDPOINT setting must be set using either "
"the environment variable or the config file."
)

async def _send_query(self, query: str, mediatype="text/turtle"):
"""Sends a SPARQL query asynchronously.
Expand Down

0 comments on commit 06307aa

Please sign in to comment.