-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
@@ -33,6 +33,10 @@ func (k *KindDetails) EnsureExtendedTimeDetails() error { | |||
return fmt.Errorf("extended time details is not set") | |||
} | |||
|
|||
if k.ExtendedTimeDetails.Format == "" { |
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.
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 { |
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.
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() { |
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.
Renamed the variable so it's less confusing
String()
methodExtendedTime
return nil, err | ||
} | ||
|
||
return castedValue.GetTime().Format(s.kd.ExtendedTimeDetails.Format), nil |
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.
Use the column format instead of .String()
which relies on the value format.
More changes, including removing the
.String()
method.I added comments to every major change in the PR.