Skip to content

Commit 5ee6057

Browse files
committed
fix: yarn lint
1 parent 21d6d3d commit 5ee6057

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

packages/cubejs-schema-compiler/src/scaffolding/ScaffoldingSchema.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,14 +388,14 @@ export class ScaffoldingSchema {
388388
if (['time', 'date'].find(t => type.includes(t))) {
389389
return ColumnType.Time;
390390
} else if ([
391-
'int', // integer, bigint, smallint, tinyint, mediumint, uint8, uint16, uint32, uint64, uinteger, ubigint, usmallint, hugeint, byteint, etc.
392-
'dec', // decimal
393-
'double', // double, double precision
394-
'numb', // number, numeric, bignumeric
395-
'float', // float, float4, float8, float32, float64, binary_float
396-
'real', // real
397-
'serial', // serial, bigserial, smallserial
398-
'money', // money, smallmoney
391+
'int', // integer, bigint, smallint, tinyint, mediumint, uint8, uint16, uint32, uint64, uinteger, ubigint, usmallint, hugeint, byteint, etc.
392+
'dec', // decimal
393+
'double', // double, double precision
394+
'numb', // number, numeric, bignumeric
395+
'float', // float, float4, float8, float32, float64, binary_float
396+
'real', // real
397+
'serial', // serial, bigserial, smallserial
398+
'money', // money, smallmoney
399399
].find(t => type.includes(t))) {
400400
// enums are not Numbers
401401
return ColumnType.Number;

packages/cubejs-schema-compiler/test/unit/scaffolding-schema.test.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ describe('ScaffoldingSchema', () => {
557557

558558
describe('columnType mapping for numeric types', () => {
559559
it('should map FLOAT types to number', () => {
560-
const schemas = {
560+
const floatSchemas = {
561561
public: {
562562
test: [
563563
{ name: 'float_col', type: 'FLOAT', attributes: [] },
@@ -568,24 +568,24 @@ describe('ScaffoldingSchema', () => {
568568
]
569569
}
570570
};
571-
const schema = new ScaffoldingSchema(schemas);
572-
schemas.public.test.forEach(col => {
573-
expect(schema['columnType'](col)).toBe('number');
571+
const schema = new ScaffoldingSchema(floatSchemas);
572+
floatSchemas.public.test.forEach(col => {
573+
expect((schema as any).columnType(col)).toBe('number');
574574
});
575575
});
576576

577577
it('should map REAL type to number', () => {
578-
const schemas = {
578+
const realSchemas = {
579579
public: {
580580
test: [{ name: 'real_col', type: 'REAL', attributes: [] }]
581581
}
582582
};
583-
const schema = new ScaffoldingSchema(schemas);
584-
expect(schema['columnType'](schemas.public.test[0])).toBe('number');
583+
const schema = new ScaffoldingSchema(realSchemas);
584+
expect((schema as any).columnType(realSchemas.public.test[0])).toBe('number');
585585
});
586586

587587
it('should map SERIAL types to number', () => {
588-
const schemas = {
588+
const serialSchemas = {
589589
public: {
590590
test: [
591591
{ name: 'serial_col', type: 'SERIAL', attributes: [] },
@@ -594,29 +594,29 @@ describe('ScaffoldingSchema', () => {
594594
]
595595
}
596596
};
597-
const schema = new ScaffoldingSchema(schemas);
598-
schemas.public.test.forEach(col => {
599-
expect(schema['columnType'](col)).toBe('number');
597+
const schema = new ScaffoldingSchema(serialSchemas);
598+
serialSchemas.public.test.forEach(col => {
599+
expect((schema as any).columnType(col)).toBe('number');
600600
});
601601
});
602602

603603
it('should map MONEY types to number', () => {
604-
const schemas = {
604+
const moneySchemas = {
605605
public: {
606606
test: [
607607
{ name: 'money_col', type: 'MONEY', attributes: [] },
608608
{ name: 'smallmoney_col', type: 'SMALLMONEY', attributes: [] },
609609
]
610610
}
611611
};
612-
const schema = new ScaffoldingSchema(schemas);
613-
schemas.public.test.forEach(col => {
614-
expect(schema['columnType'](col)).toBe('number');
612+
const schema = new ScaffoldingSchema(moneySchemas);
613+
moneySchemas.public.test.forEach(col => {
614+
expect((schema as any).columnType(col)).toBe('number');
615615
});
616616
});
617617

618618
it('should map various integer types to number (covered by int keyword)', () => {
619-
const schemas = {
619+
const intSchemas = {
620620
public: {
621621
test: [
622622
// Standard integer types
@@ -633,14 +633,14 @@ describe('ScaffoldingSchema', () => {
633633
]
634634
}
635635
};
636-
const schema = new ScaffoldingSchema(schemas);
637-
schemas.public.test.forEach(col => {
638-
expect(schema['columnType'](col)).toBe('number');
636+
const schema = new ScaffoldingSchema(intSchemas);
637+
intSchemas.public.test.forEach(col => {
638+
expect((schema as any).columnType(col)).toBe('number');
639639
});
640640
});
641641

642642
it('should be case insensitive for type matching', () => {
643-
const schemas = {
643+
const caseSchemas = {
644644
public: {
645645
test: [
646646
{ name: 'float_lower', type: 'float', attributes: [] },
@@ -649,9 +649,9 @@ describe('ScaffoldingSchema', () => {
649649
]
650650
}
651651
};
652-
const schema = new ScaffoldingSchema(schemas);
653-
schemas.public.test.forEach(col => {
654-
expect(schema['columnType'](col)).toBe('number');
652+
const schema = new ScaffoldingSchema(caseSchemas);
653+
caseSchemas.public.test.forEach(col => {
654+
expect((schema as any).columnType(col)).toBe('number');
655655
});
656656
});
657657
});

0 commit comments

Comments
 (0)