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

Feature/schema property dataset #140

Merged
merged 5 commits into from
Aug 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion typedspark/_core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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)```

Copy link
Collaborator Author

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

Copy link
Collaborator

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!


Expand Down