Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static type checking #39

Merged
merged 60 commits into from
Sep 5, 2024
Merged

Static type checking #39

merged 60 commits into from
Sep 5, 2024

Conversation

wangpatrick57
Copy link
Member

@wangpatrick57 wangpatrick57 commented Sep 2, 2024

Summary: added mypy --strict to CI and fixed all type errors (~900 total) found by it. This also found and fixed some logical errors in the code.

Demo:
Screenshot 2024-09-03 at 13 53 11
Passing CI

Details:

  • Readability is much better now that everything is typed.
  • mypy found that we were using a feature from torch 2.4.0 so I upgraded torch from 2.0.0 -> 2.4.0.
  • Some type errors were because of dead code. These were removed.
  • Some type errors showed places where we were using the wrong type.
  • Many asserts were added for Optional[...] types.
  • Fixed a previously confusing situation around mixing psycopg.Connection and sqlalchemy.Connection in pg.py:create_conn().

Copy link
Collaborator

@lmwnshn lmwnshn left a comment

Choose a reason for hiding this comment

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

Rubber stamp.

@wangpatrick57 wangpatrick57 merged commit ac849f8 into cmu-db:main Sep 5, 2024
1 check 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.

2 participants