Skip to content

refactor: remove dead logs and file_path parameters from pipeline functions #202

Description

@boscorat

Parent issue

#194 — function purification

Problem

The logs: pl.DataFrame and file_path: str parameters are accepted but never used in the function body across 14 functions in the extraction pipeline:

Function File:Line
spawn_locations statement_functions.py:77
strip statement_functions.py:111
build_pattern statement_functions.py:145
patmatch statement_functions.py:163
cast statement_functions.py:187
trim statement_functions.py:247
validate statement_functions.py:266
cleanup statement_functions.py:276
get_region pdf_functions.py:26
pdf_open pdf_functions.py:42
pdf_close pdf_functions.py:56
page_crop pdf_functions.py:67
region_search pdf_functions.py:85
page_text pdf_functions.py:99

These dead parameters clutter every call site and obscure which arguments actually matter.

Proposal

Remove the unused logs and file_path parameters from all affected functions. Update all call sites.

Code relationships

Target functions (dead params to remove):

  • 8 functions in statement_functions.py
  • 6 functions in pdf_functions.py

Callers (will need updating):

  • extract_fields()statement_functions.py:314 (calls get_region, get_table_from_region)
  • get_results()statement_functions.py:688 (calls spawn_locations, extract_fields)
  • Statement.get_results()statements.py:631 (calls module-level get_results)
  • ImportConfigManager.identify_from_pdf()import_config.py:385 (calls get_results)
  • ImportConfigManager.get_config_from_company()import_config.py:454 (calls get_results)
  • ImportConfigManager.get_config_from_statement()import_config.py:496 (calls get_results)

Siblings (also take unused logs/file_path):

  • get_table_from_region()pdf_functions.py:109 (same pattern, 14 params)

Existing tests

None. None of these functions have direct test coverage. Removing unused parameters will not break any existing tests.

Siblings

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorcode refactoring

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions