Skip to content

Add comprehensive test suite and fix two pandas 3.0 bugs#26

Merged
pvernier merged 1 commit intomainfrom
add-tests
Mar 26, 2026
Merged

Add comprehensive test suite and fix two pandas 3.0 bugs#26
pvernier merged 1 commit intomainfrom
add-tests

Conversation

@pvernier
Copy link
Copy Markdown
Owner

Tests: 5 → 53 (+48)

  • test_form.py: add tests for repr, display validation, column dedup, remove_unused_columns, extract_repeats, fetch_data (happy path, API error, missing columns), display label/name round-trip
  • test_manager.py: add tests for get_forms, get_form (found/not-found/ empty), _create_koboform, share_project, upload_media_from_local (bad ext / file missing), fetch_users_with_access
  • test_utility.py: new file covering all utility functions

Bug fixes revealed by the new tests:

  • utility.py: replace df.applymap() with df.map() (removed in pandas 3.0)
  • form.py: use None instead of np.nan for missing survey columns so the column gets object dtype; pandas 3.0 rejects string assignment into a float64 column even on an empty slice

Tests: 5 → 53 (+48)
- test_form.py: add tests for repr, display validation, column dedup,
  remove_unused_columns, extract_repeats, fetch_data (happy path,
  API error, missing columns), display label/name round-trip
- test_manager.py: add tests for get_forms, get_form (found/not-found/
  empty), _create_koboform, share_project, upload_media_from_local
  (bad ext / file missing), fetch_users_with_access
- test_utility.py: new file covering all utility functions

Bug fixes revealed by the new tests:
- utility.py: replace df.applymap() with df.map() (removed in pandas 3.0)
- form.py: use None instead of np.nan for missing survey columns so
  the column gets object dtype; pandas 3.0 rejects string assignment
  into a float64 column even on an empty slice

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@pvernier pvernier merged commit 526bc84 into main Mar 26, 2026
1 of 2 checks passed
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