-
Notifications
You must be signed in to change notification settings - Fork 105
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
fix: Improve linting/editor experience for hera models. #950
fix: Improve linting/editor experience for hera models. #950
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #950 +/- ##
=====================================
Coverage 81.5% 81.5%
=====================================
Files 52 52
Lines 4079 4091 +12
Branches 851 851
=====================================
+ Hits 3325 3337 +12
Misses 562 562
Partials 192 192 ☔ View full report in Codecov by Sentry. |
@@ -7,7 +7,7 @@ | |||
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union | |||
|
|||
from hera.auth import TokenGenerator | |||
from hera.shared._pydantic import BaseModel, root_validator | |||
from hera.shared._pydantic import BaseModel, get_fields, root_validator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this get_fields
thing I did mainly to avoid littering all the existing raw usages of __fields__
with # type: ignore
because there's version specific linter error I was seeming to get.
Signed-off-by: DanCardin <ddcardin@gmail.com>
f5a1a85
to
b5f0c8e
Compare
The failing py3.8 build gives me no logs, so i wonder if it's actually a transient CI issue? And the coverage changes, I think are lies. There should be net no line coverage difference, as far as I can tell. |
Pull Request Checklist
Description of PR
Today, hera models seem to receive no editor/linter support for the
__init__
arguments of hera models.This seems to be solely from the necessary try/except imports used to support both pydantic v1 and v2. Both mypy and pyright will bail on and not yield useful types when you do this. But it can be hacked around with some more conditionals imports 😅
Today:
With this change: