summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2019-12-13 16:34:03 +0100
committerMartin Czygan <martin.czygan@gmail.com>2019-12-13 16:34:03 +0100
commitc642052f1b7df58ef38b5f16a5f2a198d9960666 (patch)
tree4c4944677f8e398e7324f94b51f7522c3c44f1dc /python
parent374ed6ccac6191461616ac3df85daf3a3a9ab2ed (diff)
downloadfatcat-c642052f1b7df58ef38b5f16a5f2a198d9960666.tar.gz
fatcat-c642052f1b7df58ef38b5f16a5f2a198d9960666.zip
Update EntityImporter docstring.
I believe the required method is `parse_record`, not `parse`.
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/common.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/python/fatcat_tools/importers/common.py b/python/fatcat_tools/importers/common.py
index c0740f94..c9648173 100644
--- a/python/fatcat_tools/importers/common.py
+++ b/python/fatcat_tools/importers/common.py
@@ -256,7 +256,7 @@ class EntityImporter:
The API that implementations are expected to fill in are:
want(raw_record) -> boolean
- parse(raw_record) -> entity
+ parse_record(raw_record) -> entity
try_update(entity) -> boolean
insert_batch([entity]) -> None
@@ -389,20 +389,11 @@ class EntityImporter:
"""
return True
- def parse(self, raw_record):
- """
- Returns an entity class type, or None if we should skip this one.
-
- May have side-effects (eg, create related entities), but shouldn't
- update/mutate the actual entity.
- """
- raise NotImplementedError
-
def try_update(self, raw_record):
"""
- Passed the output of parse(). Should try to find an existing entity and
- update it (PUT), decide we should do nothing (based on the existing
- record), or create a new one.
+ Passed the output of parse_record(). Should try to find an existing
+ entity and update it (PUT), decide we should do nothing (based on the
+ existing record), or create a new one.
Implementations must update the exists/updated/skip counts
appropriately in this method.