Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Dec 1, 2023
1 parent df62447 commit 37bbd2c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[mypy]
mypy_path=./src
packages=collective.elastic.ingest
4 changes: 2 additions & 2 deletions src/collective/elastic/ingest/celery.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .ingest import ingest
from .ingestion import process_ingest
from .logging import logger
from .plone import fetch_content
from .plone import fetch_schema
Expand Down Expand Up @@ -52,7 +52,7 @@ def index(path, timestamp, index_name):
logger.exception(msg)
return msg
try:
ingest(content, schema, index_name)
process_ingest(content, schema, index_name)
except Exception:
# xxx: retry handling!
msg = "Error while writing data to ElasticSearch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def setup_ingest_pipelines(full_schema, index_name):
client.ingest.delete_pipeline(pipeline_name)


def ingest(content, full_schema, index_name):
def process_ingest(content, full_schema, index_name):
"""Process content and schema.
This brings it together: Preprocess, create a mapping (and index/pipelines if not exists yet),
Expand Down
4 changes: 2 additions & 2 deletions src/collective/elastic/ingest/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def action_empty_removal(content, full_schema, key):
ACTION_FUNCTIONS["remove_empty"] = action_empty_removal


def action_strip_vocabulary_term_titles(content, full_schema):
def action_strip_vocabulary_term_titles(content, full_schema, config):
"""If field with vocabulary: Convert field value to token or list of tokens."""
for fieldname, field in content.items():
if isinstance(field, dict) and set(field.keys()) == {"title", "token"}:
Expand All @@ -173,7 +173,7 @@ def action_strip_vocabulary_term_titles(content, full_schema):
ACTION_FUNCTIONS["strip_vocabulary_term_titles"] = action_strip_vocabulary_term_titles


def action_enrich_with_section(content, fullschema):
def action_enrich_with_section(content, fullschema, config):
"""Add section to content.
TODO: make this take the site root into account and remove this step (see below)
Expand Down

0 comments on commit 37bbd2c

Please sign in to comment.