diff options
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/db/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gn3/db/__init__.py b/gn3/db/__init__.py index 95b39d4..9a86ad8 100644 --- a/gn3/db/__init__.py +++ b/gn3/db/__init__.py @@ -1,5 +1,6 @@ # pylint: disable=[R0902, R0903] """Module that exposes common db operations""" +import logging from dataclasses import asdict, astuple from typing import Any, Dict, List, Optional, Generator, Tuple, Union from typing_extensions import Protocol @@ -17,6 +18,8 @@ from gn3.db.phenotypes import phenotype_mapping from gn3.db.phenotypes import publication_mapping from gn3.db.phenotypes import publish_x_ref_mapping +logger = logging.getLogger(__name__) + TABLEMAP = { "Phenotype": phenotype_mapping, @@ -45,6 +48,11 @@ def update(conn: Any, data: Dataclass, where: Dataclass) -> Optional[int]: """Run an UPDATE on a table""" + logger.warning( + "DEPRECATION WARNING: The function `%s.update` is deprecated and will " + "be removed soon. **DO NOT** use it, and remove all references to it " + "from your code.", + __name__) if not (any(astuple(data)) and any(astuple(where))): return None data_ = {k: v for k, v in asdict(data).items() |