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

remove fields on auto-completion of subclasses of pydantic.BaseModel … #61

Merged
merged 3 commits into from
Sep 2, 2019

Conversation

koxudaxi
Copy link
Owner

@koxudaxi koxudaxi commented Sep 1, 2019

The PR removes fields on auto-completion which is subclasses of pydantic.BaseModel and pydantic.dataclasses.dataclass.
A real class does not have fields as class attributes.
The fields appear on an instance.
However, auto-completion show fields as class attributes.

eg:

class A(BaseModel):
  abc: str = None

A.abc  # invalid
A().abc # corret

@codecov
Copy link

codecov bot commented Sep 1, 2019

Codecov Report

Merging #61 into master will decrease coverage by 2.05%.
The diff coverage is 61.29%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #61      +/-   ##
============================================
- Coverage     81.41%   79.35%   -2.06%     
  Complexity       76       76              
============================================
  Files             7        7              
  Lines           312      339      +27     
  Branches        100      111      +11     
============================================
+ Hits            254      269      +15     
- Misses           16       20       +4     
- Partials         42       50       +8
Impacted Files Coverage Δ Complexity Δ
...koxudaxi/pydantic/PydanticCompletionContributor.kt 83.18% <61.29%> (-8.68%) 1 <0> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 831a713...489e057. Read the comment docs.

@koxudaxi koxudaxi merged commit f14a4a2 into master Sep 2, 2019
@koxudaxi koxudaxi deleted the remove_fields_on_auto-completion_of_subclasses branch September 2, 2019 05:23
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.

None yet

1 participant