Skip to content

Conversation

@wmobley
Copy link
Contributor

@wmobley wmobley commented Oct 1, 2025

it seems i had some issues with the typing. Can you confirm this works before we merge?

wmobley and others added 5 commits October 1, 2025 13:22
The delete campaign route function was incorrectly named 'delete_sensor'
instead of 'delete_campaign'. This fix corrects the function name to
match its actual purpose.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Remove redundant | None from Optional[str] | None type annotation.
Optional[str] already includes None, so | None is unnecessary and
causes a syntax error.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Replace all instances of modern union syntax (Type | None and type1 | type2)
with Python 3.9 compatible typing imports (Optional[Type] and Union[type1, type2]).

Fixed files:
- app/services/station_service.py: Replace Type | None and list[str | None]
- app/db/repositories/station_repository.py: Replace Station | None
- app/db/repositories/measurement_repository.py: Replace various union syntax
- app/db/repositories/sensor_repository.py: Replace Sensor | None and list types
- app/db/repositories/campaign_repository.py: Replace Campaign | None
- app/services/measurement_service.py: Replace MeasurementCreateResponse | None
- app/services/export_service.py: Replace datetime | None
- app/api/v1/schemas/station.py: Replace str | None, bool | None, datetime | None
- app/api/v1/routes/campaigns/campaign_stations.py: Replace datetime | None
- app/api/v1/routes/campaigns/root.py: Replace str | None, datetime | None, list[str] | None

All modules now import successfully in Python 3.9.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@wmobley wmobley requested a review from mosoriob October 1, 2025 18:54
wmobley and others added 3 commits October 1, 2025 13:58
Replace deprecated 'example' parameter with 'examples' in Query
annotations to resolve deprecation warnings in FastAPI.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Replace modern union syntax (Type | None) with Python 3.9 compatible
syntax (Optional[Type]) in test files to resolve 17 test errors.

Changes:
- tests/api/test_campaign_station_sensors.py: Updated union syntax in lines 121-126
- tests/test_campaign_station_sensor_measurement_routes.py: Updated union syntax in lines 83, 93
- tests/test_measurement_service.py: Updated union syntax in function parameter
- Added necessary Optional import to all files
- Replaced dict[str, str] with Dict[str, str]
- Replaced list[Type] with List[Type]

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Change incorrect import from 'pandantic.basemodel.PandanticBaseModel'
to correct 'pandantic.BaseModel' to resolve CI test failures.

The pandantic library exports BaseModel from its __init__.py, not
PandanticBaseModel from basemodel.py.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@wmobley wmobley closed this Oct 1, 2025
@wmobley wmobley removed the request for review from mosoriob October 1, 2025 19:20
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.

2 participants