Skip to content
Snippets Groups Projects
Commit 70bf1dbe authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: depricate get_file

parent 50c9241f
No related branches found
No related tags found
1 merge request!160STY: styling
Pipeline #47058 passed
......@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- More aggressive caching.
### Deprecated ###
- `IdentifiableAdapter.get_file`
### Removed ###
......
......@@ -26,6 +26,7 @@
from __future__ import annotations
import logging
import warnings
from abc import ABCMeta, abstractmethod
from datetime import datetime
from functools import lru_cache
......@@ -175,6 +176,7 @@ identifiabel, identifiable and identified record) for a Record.
@abstractmethod
def get_file(self, identifiable: db.File):
warnings.warn(DeprecationWarning("This function is depricated. Please do not use it."))
"""
Retrieve the file object for a (File) identifiable.
"""
......@@ -324,6 +326,7 @@ class LocalStorageIdentifiableAdapter(IdentifiableAdapter):
Just look in records for a file with the same path.
"""
candidates = []
warnings.warn(DeprecationWarning("This function is depricated. Please do not use it."))
for record in self._records:
if record.role == "File" and record.path == identifiable.path:
candidates.append(record)
......@@ -471,6 +474,7 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter):
self._registered_identifiables[name] = definition
def get_file(self, identifiable: Identifiable):
warnings.warn(DeprecationWarning("This function is depricated. Please do not use it."))
# TODO is this needed for Identifiable?
# or can we get rid of this function?
if isinstance(identifiable, db.Entity):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment