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

Provider and lookup typing #795

Merged
merged 49 commits into from
Sep 13, 2024

Conversation

FlorianBracq
Copy link
Collaborator

  • Add more typing to msticpy/context files
    • Replace outdated List/Union/Tuple/Dict/Set/Optional
    • Add types in function definition
    • Replace namedtuple and attr classes with dataclasses
    • Exploding (some) kwargs to use explicit parameters
  • Replace print with logging
  • Remove redundant disabled pylint messages
  • Set error messages in dedicated variables
  • Forcing keyword-only arguments for boolean parameters
  • Replacing some hard-coded values
    • check httpx return code with property "is_success" instead of comparing to 200

FlorianBracq and others added 30 commits June 26, 2024 16:47
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@FlorianBracq FlorianBracq changed the title Provider and driver typing Provider and lookup typing Aug 12, 2024
@FlorianBracq FlorianBracq marked this pull request as ready for review September 8, 2024 09:36
Copy link
Contributor

@ianhelle ianhelle left a comment

Choose a reason for hiding this comment

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

I'm exhausted looking at that - and I mostly just skimmed through. :-)
What an amazing amount of work!

I left a few comments - mostly about help/output that should be user-visible.

msticpy/context/provider_base.py Outdated Show resolved Hide resolved
msticpy/context/tiproviders/kql_base.py Show resolved Hide resolved
msticpy/context/lookup.py Show resolved Hide resolved
@ianhelle
Copy link
Contributor

ianhelle commented Sep 12, 2024

Also, did you use some kind of tool to do all of the annotation updates?

@FlorianBracq
Copy link
Collaborator Author

Also, did you use some kind of tool to do all of the annotation updates?

I'm mostly using ruff for it. It's not perfect, but it provides quite some good guidance. It's a pain to write and review (sorry for that ;)), but it does help making the code clearer and prevents some mistakes, so I would say it's worth it!

@ianhelle ianhelle merged commit 4734c66 into microsoft:main Sep 13, 2024
8 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.

2 participants