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: resolve user agent warning in wikibase #446

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Changes from all 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
7 changes: 7 additions & 0 deletions src/therapy/etl/wikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@

import datetime
import json
import os
from pathlib import Path
from typing import Any

from tqdm import tqdm
from wags_tails import CustomData, DataSource
from wags_tails.utils.versioning import DATE_VERSION_PATTERN
from wikibaseintegrator.wbi_config import config as wbi_config
from wikibaseintegrator.wbi_helpers import execute_sparql_query

from therapy import XREF_SOURCES
from therapy.etl.base import Base, EtlError
from therapy.schemas import NamespacePrefix, RecordParams, SourceMeta, SourceName

wbi_config["USER_AGENT"] = (
os.environ.get("WIKIBASE_USER_AGENT")
or "thera_py (https://github.com/cancervariants/therapy-normalization)"
)

# Translate Wikidata keys to standardized namespaces
NAMESPACES = {
"casRegistry": NamespacePrefix.CASREGISTRY.value,
Expand Down
Loading