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

fix: add type hints to all component __init__ constructor parameters #3152

Merged
merged 1 commit into from
Sep 6, 2022
Merged

fix: add type hints to all component __init__ constructor parameters #3152

merged 1 commit into from
Sep 6, 2022

Conversation

vblagoje
Copy link
Member

@vblagoje vblagoje commented Sep 5, 2022

Related Issues

Proposed Changes:

Make sure all components have all __init__ parameters typed
Make sure all components have the model_version optional parameter - where applicable

How did you test it?

No additional tests were added, verified schema has changed.

Notes for the reviewer

Please make sure all components now have all __init__ parameters typed
Please make sure all components now have model_version parameter - if applicable

@vblagoje vblagoje requested review from a team as code owners September 5, 2022 08:36
@vblagoje vblagoje requested review from masci and brandenchan and removed request for a team and masci September 5, 2022 08:36
@@ -44,6 +44,7 @@ class EntityExtractor(BaseComponent):
def __init__(
self,
model_name_or_path: str = "dslim/bert-base-NER",
model_version: Optional[str] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a line in the docstring for this param

self,
knowledge_graph: BaseKnowledgeGraph,
model_name_or_path: str,
model_version: Optional[str] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a line in the docstring for this param

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, totally forgot - thanks Branden

@vblagoje
Copy link
Member Author

vblagoje commented Sep 5, 2022

@brandenchan should be rebased and ready to go now. Please have another look

@brandenchan brandenchan self-requested a review September 5, 2022 13:53
Copy link
Contributor

@brandenchan brandenchan left a comment

Choose a reason for hiding this comment

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

LGTM

@vblagoje vblagoje marked this pull request as draft September 5, 2022 14:57
@vblagoje vblagoje marked this pull request as ready for review September 5, 2022 14:57
@vblagoje vblagoje merged commit 84acb65 into deepset-ai:main Sep 6, 2022
@masci masci changed the title Add type hints to all component __init__ constructor parameters fix: add type hints to all component __init__ constructor parameters Sep 21, 2022
@vblagoje vblagoje deleted the init_type_hints branch October 24, 2022 08:21
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.

Add type hints to all component __init__ constructor parameters
2 participants