Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ describe('spec utils', () => {
expect(guessColumnTypeFromInput([null, 1, 2.1, 3], true)).toEqual('double');
expect(guessColumnTypeFromInput([null, '1', '2.1', '3'], false)).toEqual('string');
expect(guessColumnTypeFromInput([null, '1', '2.1', '3'], true)).toEqual('double');
expect(guessColumnTypeFromInput([null, '1.0', '2.0', '3.0'], true)).toEqual('double');
});

it('works for ARRAY<string>', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2504,7 +2504,9 @@ function isIntegerOrNull(x: any): boolean {

function isIntegerOrNullAcceptString(x: any): boolean {
return (
x == null || ((typeof x === 'number' || typeof x === 'string') && Number.isInteger(Number(x)))
x == null ||
(typeof x === 'number' && Number.isInteger(x)) ||
(typeof x === 'string' && !x.includes('.') && Number.isInteger(Number(x)))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ export const InputFormatStep = React.memo(function InputFormatStep(props: InputF
inputSourceAndFormat.inputSource,
);

const needsResample = inputSourceAndFormatToSample !== inputSourceAndFormat;
const nextDisabled = !inputSourceFormatAndMore || needsResample;

return (
<div className="input-format-step">
<div className="preview">
Expand Down Expand Up @@ -246,7 +249,7 @@ export const InputFormatStep = React.memo(function InputFormatStep(props: InputF
onChange={setInputSourceAndFormat as any}
/>
)}
{inputSourceAndFormatToSample !== inputSourceAndFormat && (
{needsResample && (
<FormGroup className="control-buttons">
<Button
text="Preview changes"
Expand Down Expand Up @@ -283,7 +286,7 @@ export const InputFormatStep = React.memo(function InputFormatStep(props: InputF
text={altText}
rightIcon={IconNames.ARROW_TOP_RIGHT}
minimal
disabled={!inputSourceFormatAndMore}
disabled={nextDisabled}
onClick={() => {
if (!inputSourceFormatAndMore) return;
onAltSet(inputSourceFormatAndMore);
Expand All @@ -299,7 +302,7 @@ export const InputFormatStep = React.memo(function InputFormatStep(props: InputF
text={doneButton ? 'Done' : 'Next'}
rightIcon={doneButton ? IconNames.TICK : IconNames.ARROW_RIGHT}
intent={Intent.PRIMARY}
disabled={!inputSourceFormatAndMore}
disabled={nextDisabled}
onClick={() => {
if (!inputSourceFormatAndMore) return;
onSet(inputSourceFormatAndMore);
Expand Down