-
Notifications
You must be signed in to change notification settings - Fork 425
fix: DayTransform result type override and docs #1208
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -491,7 +491,7 @@ class DayTransform(TimeTransform[S]): | |
| """Transforms a datetime value into a day value. | ||
|
|
||
| Example: | ||
| >>> transform = MonthTransform() | ||
| >>> transform = DayTransform() | ||
| >>> transform.transform(DateType())(17501) | ||
| 17501 | ||
| """ | ||
|
|
@@ -517,9 +517,6 @@ def day_func(v: Any) -> int: | |
| def can_transform(self, source: IcebergType) -> bool: | ||
| return isinstance(source, (DateType, TimestampType, TimestamptzType)) | ||
|
|
||
| def result_type(self, source: IcebergType) -> IcebergType: | ||
| return DateType() | ||
|
|
||
|
Comment on lines
-520
to
-522
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can we be explicit here and do
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm matching the behavior of the other transforms that extend
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gotcha, thanks for the context. This is fine! |
||
| @property | ||
| def granularity(self) -> TimeResolution: | ||
| return TimeResolution.DAY | ||
|
|
||
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.
ty!