Skip to content

Better typing#174

Merged
DanielElisenberg merged 13 commits intomainfrom
better_typing
Sep 17, 2025
Merged

Better typing#174
DanielElisenberg merged 13 commits intomainfrom
better_typing

Conversation

@DanielElisenberg
Copy link
Collaborator

Better Typing

  • Upgrade microdata-tools
  • Fix ruff lints
  • Fix pyright errors
  • Moved datastore from model to domain

Notes

Had to break out a bunch of # type: ignore since we are overriding a bunch of pydantic init methods to read from the file system. This should be fixed for a bunch of other reasons. But it should be a part of a planned refactor and not a PR for improved typing.

@DanielElisenberg DanielElisenberg requested a review from a team as a code owner September 12, 2025 10:16
haraldsvik
haraldsvik previously approved these changes Sep 12, 2025
Copy link
Contributor

@haraldsvik haraldsvik left a comment

Choose a reason for hiding this comment

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

Great job! Feels good to have improved typing! 🦄

just have a few comments/questions

update_type: Union[str, None]
data_structure_updates: List[DataStructureUpdate]
update_type: str | None
data_structure_updates: list[DataStructureUpdate]
Copy link
Contributor

Choose a reason for hiding this comment

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

I see you updated List -> to list a few places, but we still use it many places. I know its a chore to update all the references 😅 and it doesn't really affect anything except consistency.
Super nitpicky sorry! 🙇 It just became alot more visible when all the rest of the typing improved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a housekeeping PR so if there is a place to nitpick it's here 👍🏻 I'll take a walk through the repo and catch the inconsistencies 💯

operation="PATCH_METADATA",
description=description,
releaseStatus="DRAFT",
release_status="DRAFT",
Copy link
Contributor

Choose a reason for hiding this comment

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

I see there is alot of references for both releaseStatus and release_status
release_status is for "job-service" and "releaseStatus" is for datastore right? Its a little confusing when its been a while since I've looked at those part. I first thought i was missing some conversions somewhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll take a look around, but pyright wants us to use the actual field names rather than the camelcased alias in the python code (which is way prettier) so I have fixed all these lints

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 15, 2025

Quality Gate Passed Quality Gate passed

Issues
5 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link
Contributor

@haraldsvik haraldsvik left a comment

Choose a reason for hiding this comment

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

Looks good! lots of great changes 💯

queued_worker_jobs: List[Job]
built_jobs: List[Job]
queued_manager_jobs: List[Job]
queued_worker_jobs: list[Job]
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹

@DanielElisenberg DanielElisenberg merged commit 23151d9 into main Sep 17, 2025
5 of 7 checks passed
@DanielElisenberg DanielElisenberg deleted the better_typing branch September 17, 2025 07:32
@DanielElisenberg DanielElisenberg linked an issue Sep 22, 2025 that may be closed by this pull request
4 tasks
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.

Improve Quality: job-executor

2 participants