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

Refactoring Extended Time #967

Merged
merged 3 commits into from
Oct 21, 2024
Merged

Refactoring Extended Time #967

merged 3 commits into from
Oct 21, 2024

Conversation

Tang8330
Copy link
Contributor

  • Removing NewKindDetailsFromTemplate
  • Renaming TimestampTz

@@ -11,7 +11,7 @@ import (
type ExtendedTimeKindType string

const (
TimestampTzKindType ExtendedTimeKindType = "timestamp_tz"
TimestampTZKindType ExtendedTimeKindType = "timestamp_tz"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uppercase

@@ -28,8 +28,8 @@ var (
Format: RFC3339NanosecondNoTZ,
}

TimestampTz = NestedKind{
Type: TimestampTzKindType,
TimestampTZ = NestedKind{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uppercase

@@ -92,15 +93,6 @@ func NewExtendedTimeDetails(details KindDetails, extendedType ext.ExtendedTimeKi
return details
}

func NewKindDetailsFromTemplate(details KindDetails, extendedType ext.ExtendedTimeKindType) KindDetails {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this function

@Tang8330 Tang8330 marked this pull request as ready for review October 17, 2024 21:50
@Tang8330 Tang8330 requested a review from a team as a code owner October 17, 2024 21:50
@@ -12,7 +12,7 @@ import (
type Time struct{}

func (Time) ToKindDetails() typing.KindDetails {
return typing.NewKindDetailsFromTemplate(typing.ETime, ext.TimeKindType)
return typing.NewExtendedTimeDetails(typing.ETime, ext.TimeKindType, "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make this method take a receiver t and use t.layout() as the last arg here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can. Maybe as a 2nd pass? We're not passing a layout into the ExtTime right now.

And if we did, we should be using a ms precision string rather than the default which is microsecond precision

}
{
// In memory is timestamp_ntz and destination is timestamp_tz
tableData := &TableData{inMemoryColumns: &columns.Columns{}}
kd := typing.NewKindDetailsFromTemplate(typing.ETime, ext.TimestampNTZKindType)
kd := typing.NewExtendedTimeDetails(typing.ETime, ext.TimestampNTZKindType, "")
kd.ExtendedTimeDetails.Format = ext.RFC3339MillisecondNoTZ
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be passed into the constructor on the line above, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it can!

@Tang8330 Tang8330 merged commit e013990 into master Oct 21, 2024
3 checks passed
@Tang8330 Tang8330 deleted the refactor-extended-time branch October 21, 2024 21:51
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