Skip to content

Conversation

@kaapstorm
Copy link
Contributor

Changes the GitHub "test" workflow to check typing in all files instead of just two.

Resolves all typing issues encountered.

No changes to functionality.

🐡

- Changed Python version from 3.9 to 3.10 to support pattern matching
  syntax in pytest.

- Added per-module options to disable arg-type errors for test files
  that use dict unpacking with TableSpec.
@kaapstorm kaapstorm requested review from millerdev and nospame January 6, 2026 20:50

iterator = RepeatableIterator(lambda: (i for i in []))
empty_list: list[int] = []
iterator = RepeatableIterator(lambda: (i for i in empty_list))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignoring this also seemed like a good option, but "empty_list" felt nicely explicit.

Missing imports:

- Added logging import to commcare_export/excel_query.py.

- Added explicit imports for test files (jsonpath, defaultdict,
  split_leftmost, etc.).

- Added __all__ to commcare_export/__init__.py to explicitly export
  __version__.

Type annotations:

- Added type annotations for variables where mypy couldn't infer types:
  mappings, sheets_by_source, emits, depth, paginators.

- Updated generic types to include parameters: list[Any],
  dict[str, int], etc.

Property override issues:

- Removed message = None from base DataExportException class and added
  it as a property.

- Removed max_column_length from base TableWriter class (defined in
  subclasses).

- Added type annotations to BaseCommand attributes to allow both str and
  None.

Other fixes:

- Changed unknown_count from string 'unknown' to int -1 in
  commcare_hq_client.py.

- Fixed tuple reassignment issue in misc.py by using a different
  variable name.

- Added null check for archive.close() in writers.py.

- Changed TableSpec.rows from Iterable[List[Any]] to List[List[Any]] to
  support mutation.

- Converted map() result to list() in minilinq.py.

- Added assertions for non-None values in utils_cli.py.

- Used CaseInsensitiveDict in test_commcare_hq_client.py.

- Added type ignore comments for SQLAlchemy and setuptools
  compatibility.
@kaapstorm
Copy link
Contributor Author

Never mind. I'll come back to this some other time.

@kaapstorm kaapstorm closed this Jan 6, 2026
@kaapstorm kaapstorm deleted the nh/mypy branch January 6, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant