-
Notifications
You must be signed in to change notification settings - Fork 3
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
ReadSpreadsheet improvements #64
Conversation
} | ||
|
||
get(row) { | ||
return this.parse(row[this.value]) | ||
return this.parse(row.get(this.value)) |
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.
This I could not explain, but row[headerValue]
would return undefined; and the documentation here mentions .get
, which does work in this case.
Not sure why it worked before, but do you see any reason to stick to []
?
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 idea. If this works then great :)
name: 'offset', | ||
type: 'Number', | ||
docs: 'Skip the first `offset` rows of the spreadsheet.', | ||
defaultValue: 0, |
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.
This does change the existing behavior!
If this is not fine, I can definitely set 1
as the default value and adjust my code :)
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, this is a better default, thanks! I'll set this in my scripts this year.
if (!identifierVal) { | ||
return | ||
} | ||
identifierVal = identifierVal instanceof String ? identifierVal.toUpperCase() : identifierVal |
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.
I had to use this "trick" to deal with non-string identifiers (ie: wcaUserId).
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.
Ah, good call. I wasn't using non-string identifiers when I did this (only email, wcaId, name).
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.
Thanks!
} | ||
|
||
get(row) { | ||
return this.parse(row[this.value]) | ||
return this.parse(row.get(this.value)) |
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 idea. If this works then great :)
if (!identifierVal) { | ||
return | ||
} | ||
identifierVal = identifierVal instanceof String ? identifierVal.toUpperCase() : identifierVal |
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.
Ah, good call. I wasn't using non-string identifiers when I did this (only email, wcaId, name).
name: 'offset', | ||
type: 'Number', | ||
docs: 'Skip the first `offset` rows of the spreadsheet.', | ||
defaultValue: 0, |
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, this is a better default, thanks! I'll set this in my scripts this year.
Following #62 I ran into small details that I think deserve some fix/improvements:
parse
a tiny bit more resilient to silly mistakes, such as trailing whitespaces, orlist
s with white spaces such as2x2, 3x3
instead of2x2,3x3
.offset
parameter: for Euros I create a "view filter" on the raw data and therefore I don't have an extra row to ignore; generally I think it should be a reasonable change.