-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/schema property dataset #140
Feature/schema property dataset #140
Conversation
@@ -87,7 +87,7 @@ def _add_schema_metadata(self) -> None: | |||
self.schema[field.name].metadata = field.metadata | |||
|
|||
@property | |||
def typedspark_schema(self) -> T: | |||
def typedspark_schema(self) -> Type[T]: | |||
"""Returns the ``Schema`` of the ``DataSet``.""" | |||
return self._schema_annotations # type: ignore |
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.
Can we remove the type: ignore
now too?
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.
Nope:
/Users/markromme/Documents/kaiko/clones/typedspark/typedspark/_core/dataset.py:92:16 - error: Expression of type "type[Schema]" cannot be assigned to return type "type[T@DataSet]"
Type "type[Schema]" cannot be assigned to type "type[T@DataSet]" (reportGeneralTypeIssues)```
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.
Which is very odd as T@DataSet is a reference of the Schema
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.
Ugh... Well, at least it's the right type now!
This seems to be the right output type.