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

Conversation

hahamark1
Copy link
Collaborator

This seems to be the right output type.

@hahamark1 hahamark1 self-assigned this Aug 8, 2023
@hahamark1 hahamark1 enabled auto-merge (squash) August 8, 2023 13:17
@@ -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!

@hahamark1 hahamark1 merged commit 340fd3c into kaiko-ai:main Aug 8, 2023
3 checks passed
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.

2 participants