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

More refactor around ExtendedTime #979

Merged
merged 11 commits into from
Oct 24, 2024
Merged

More refactor around ExtendedTime #979

merged 11 commits into from
Oct 24, 2024

Conversation

Tang8330
Copy link
Contributor

@Tang8330 Tang8330 commented Oct 23, 2024

More changes, including removing the .String() method.

I added comments to every major change in the PR.

@@ -33,6 +33,10 @@ func (k *KindDetails) EnsureExtendedTimeDetails() error {
return fmt.Errorf("extended time details is not set")
}

if k.ExtendedTimeDetails.Format == "" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an additional guardrail to ensure we don't do time.Format("")

@@ -81,8 +81,3 @@ func (e *ExtendedTime) GetTime() time.Time {
func (e *ExtendedTime) GetNestedKind() NestedKind {
return e.nestedKind
}

func (e *ExtendedTime) String(overrideFormat string) string {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer used!

@@ -119,18 +119,18 @@ func (s *Store) writeTemporaryTableFile(tableData *optimization.TableData, newTa
writer.Comma = '\t'

columns := tableData.ReadOnlyInMemoryCols().ValidColumns()
for _, value := range tableData.Rows() {
var row []string
for _, row := range tableData.Rows() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed the variable so it's less confusing

@Tang8330 Tang8330 marked this pull request as ready for review October 23, 2024 20:23
@Tang8330 Tang8330 requested a review from a team as a code owner October 23, 2024 20:23
@Tang8330 Tang8330 changed the title [ExtendedTime] Remove the String() method More refactor around ExtendedTime Oct 23, 2024
return nil, err
}

return castedValue.GetTime().Format(s.kd.ExtendedTimeDetails.Format), nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use the column format instead of .String() which relies on the value format.

@Tang8330 Tang8330 merged commit 17bc676 into master Oct 24, 2024
3 checks passed
@Tang8330 Tang8330 deleted the remove-string branch October 24, 2024 00:45
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