From a0d89d08b40c07b13a76a8afd020b0d1e62e58aa Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 2 Nov 2021 14:28:57 -0700 Subject: small python tweaks for annotations, imports --- python/fatcat_tools/importers/common.py | 2 +- python/fatcat_tools/importers/crossref.py | 6 +++++- python/fatcat_tools/transforms/elasticsearch.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/importers/common.py b/python/fatcat_tools/importers/common.py index 2c4dd496..9d22ce83 100644 --- a/python/fatcat_tools/importers/common.py +++ b/python/fatcat_tools/importers/common.py @@ -7,7 +7,7 @@ import sqlite3 import datetime import subprocess from collections import Counter -from typing import Dict, Any, List, Optional +from typing import Dict, Any, List, Optional, Tuple import lxml import xml.etree.ElementTree as ET diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py index d4b4a4c7..bd72a781 100644 --- a/python/fatcat_tools/importers/crossref.py +++ b/python/fatcat_tools/importers/crossref.py @@ -1,7 +1,11 @@ import sqlite3 import datetime +from typing import Dict, Optional, Any + import fatcat_openapi_client +from fatcat_openapi_client import ReleaseEntity + from .common import EntityImporter, clean @@ -452,7 +456,7 @@ class CrossrefImporter(EntityImporter): if not extra: extra = None - re = fatcat_openapi_client.ReleaseEntity( + re = ReleaseEntity( work_id=None, container_id=container_id, title=title, diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py index 26eacded..bfc18f83 100644 --- a/python/fatcat_tools/transforms/elasticsearch.py +++ b/python/fatcat_tools/transforms/elasticsearch.py @@ -4,7 +4,7 @@ from typing import Dict, List, Any, Optional import tldextract -from fatcat_openapi_client import ReleaseEntity, ContainerEntity +from fatcat_openapi_client import ReleaseEntity, ContainerEntity, EntityEdit, ChangelogEntry, FileEntity def check_kbart(year: int, archive: dict) -> Optional[bool]: -- cgit v1.2.3